views:

231

answers:

2

I am absolutely new to the .NET world, and started with C# on friday. I have some experience with database apps, though.

We will go with LINQ-to-SQL for a medium scale project. I am used to generating my schema from classes and keep track of changes with subversion and equivalents to Ruby's Migrations. There obviously is no easy way to do this with LINQ itself.

So I thought of generating the schema (and do some data access) with Castle Project's ActiveRecord and use Migrator.NET Tarantino or dbdeploy.net for the schema updates. (Any suggestions for this?)

My main question is: How do I verify that my LINQ classes still match the database schema? Does LINQ throw exceptions if the schema does not match? Can I iterate over all the LINQ classes and invoke some verify method?

I already found that sqlmetal is the way to regenerate the classes.

PS: We will use SQL Server (2008 or 2005).

+3  A: 

This tool will help sync them, but I'm unsure if it'll show differences...may be of some use though. (:

EDIT: As KristoferA said in his comment, it does support comparisons (: - thanks KristoferA.

Kieron
It supports both update and compare. You can read more, download, and get a trial license at http://www.huagati.com/dbmltools/
KristoferA - Huagati.com
Thanks Kieron, I was hoping for some more answers. Pointing me to DBML Tools is great. Currently I am on Visual Studio Express, so I will probably have to switch to some Pro version to use the add-in.
GrGr
+2  A: 

As for the:

I am used to generating my schema from classes and keep track of changes

I just added a DDL generation feature to Huagati DBML/EDMX Tools (ver 1.47, released today). It can generate DDL diff scripts in case you have added things to your Linq-to-SQL designer but not yet added them to the database.

KristoferA - Huagati.com