Use Forward Mapping after Reverse Mapping

Thread is closed for posting
2 posts, 0 answers
  1. Richard Bosworth
    Richard Bosworth avatar
    2 posts
    Member since:
    May 2010

    Posted 03 Jun 2010 Link to this post


    I have used OpenAccess to reverse map my database from the previous version of my application. This is fine and seems to work perfectly. However, is it possible that I could, say, add a new property in my "Developer" class and it will be reflected in the database?

    Richard Bosworth
  2. Damyan Bogoev
    Damyan Bogoev avatar
    581 posts

    Posted 04 Jun 2010 Link to this post

    Hello Richard Bosworth,

    There are two approaches that can be used in this case:
    1. Using Forward Mapping:
    - Add the new property to the class;
    - Set the UpdateDatabase property of the project to True;
    - Set the db-do-not-create-table setting in the app.config file to false for the Developer class;
    - Rebuild the project; Now the new column should show up in the table;
    - You could set the db-do-not-create-table setting back to true once the database is updated. This will prevent from other unwanted changes in the future;

    2. Using reverse mapping (the recommended way):
    - Add the new column to the table;
    - Run the Reverse mapping wizard;
    - Click on the Merge button;
    - The Schema merge summary dialog will be shown where the differences will appear;
    - Click on the Merge button;
    - When you finish with the settings click on the Generate and Save config button;
    - A new property corresponding to the added column will be generated in the class;
    Hope that helps.

    Damyan Bogoev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top