views:

188

answers:

1

I understand the reason behind not auto refreshing 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 in the database. Is there a way to refresh these files automatically if you are 100% sure that it wont break anything?

I am reasonably familiar with Migrations in RoR. Is there a dependabale Migration tool in the .NET world ?

In general, how do you stay agile with database design and dont recreate these mapping files manually again and again?

Please provide a link if this question is a duplicate. I was not able to find one.

+1  A: 

I'm not sure what your hesitation about updating the EDMX is. Just go ahead and update your model from the database. Chances are very good it will work. But if it doesn't, just get the old version from source control, and make the changes manually.

With LINQ to SQL, on the other hand, it's harder, because there is no update feature. You have to remove the changed objects from your model, re-add them, and re-apply any changes you have made, manually. Again, source control is vital here; you'll want to diff the XML files from the previous version to make sure you didn't forget anything.

I'm not sure what your question about migrations means. Yes, there is a tool (RikMigrations), which does a similar thing as migrations in Rails. But migrations, of course, change your database metadata. They don't change your ORM mapping. That's done elsewhere, both in Rails and in .NET.

Craig Stuntz
my issue is delete and drag drop edmx again..it gets kinda repeatative
Perpetualcoder
Are you thinking of Linq to SQL? EDMX is Entity Framework and doesn't need that.
Craig Stuntz