How do you manage your ORM level when the database undergoes changes?

I understand the reason for the lack of automatic updating of your .dbml (Linq2Sql),. Edmx (Linq2Entities), or .hbm.xml (NHibernate). In each of these ORM solutions, you need to update these files if you have changes to the database. Is there a way to update these files automatically if you are 100% sure that it will not break anything?

I am fairly familiar with Migrations in RoR. Is there a migration tool in the .NET world?

Overall, how can you keep up with the database design and not recreate these mapping files manually again and again?

Please provide a link if this question is a duplicate. I could not find him.

+3
source share
1 answer

I am not sure if you are unsure of updating EDMX. Just go ahead and update your model from the database. Most likely, it will work. But if it’s not, just get the old version from the original control and make the changes manually.

With LINQ to SQL, on the other hand, it is more complicated because there is no update function. You must remove the changed objects from your model, re-add them and reapply any changes you made manually. Again, source control is vital; You will want to compare the XML files with the previous version to make sure that you have not forgotten anything.

, . , (RikMigrations), Rails. , , . ORM-. , Rails, .NET.

+1

Source: https://habr.com/ru/post/1702769/


All Articles