This is a migrated thread and some comments may be shown as answers.

Updated SQL Database now how do I update reverse-engineered DAL?

2 Answers 59 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Chris
Top achievements
Rank 1
Chris asked on 11 Dec 2009, 10:16 PM
I couldn't find the answer to my question.

I added a field to several tables in my database through SSMS.  I then opened my DAL class and reverse-mapped the database again, this time, selecting Merge.  Merge saw the changes successfully and when I click Merge and then Generate & Save config, things seem to have gone well. 

The reversemapping.config has the new field "IsDeleted".  The Address.Telerik.OpenAccess.cs has the new field, but the Address.cs class does not.  Other than adding it manually is there a step that I missed?

2 Answers, 1 is accepted

Sort by
0
Chris
Top achievements
Rank 1
answered on 11 Dec 2009, 10:37 PM
Well I've gotten it taken care of by following the directions here.  I didn't particularly want to unmap the tables and then remap them.  It seems that if you select merge, it should have worked.
0
PetarP
Telerik team
answered on 14 Dec 2009, 08:40 AM
Hi Greg,

As you have noticed by default Telerik OpenAccess ORM generates two files for your Address class. One is named Address.Telerik.OpenAccess.cs and contains your private fields declarations. The other one is Address.cs and contains the public properties. Since you might have implemented some custom logic in your properties we are not regenerating the Address.cs by default because that will inevitably lead to overriding your custom logic. Instead the public declarations are generated again in the Address.Telerik.OpenAccess.cs class. You can find it at the bottom of the class in a commented block. You should expand the commented code and copy the declarations you need. After that the only thing left to do is paste it in Address.cs. This way you will have everything in place without the need to delete and regenerate your classes. 

A work around for this would be to disable the generation of partial classes. This way you will have just one class generated that will always be overridden with the latest information from your schema.


Best wishes,
Petar
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Getting Started
Asked by
Chris
Top achievements
Rank 1
Answers by
Chris
Top achievements
Rank 1
PetarP
Telerik team
Share this question
or