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

3 posts, 0 answers
  1. Chris
    Chris avatar
    20 posts
    Member since:
    Sep 2007

    Posted 11 Dec 2009 Link to this post

    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. Chris
    Chris avatar
    20 posts
    Member since:
    Sep 2007

    Posted 11 Dec 2009 Link to this post

    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.
  3. DevCraft banner
  4. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 14 Dec 2009 Link to this post

    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.
Back to Top