C# – How to verify that the LINQ-to-SQL model matches the database schema

clinq-to-sqlsql server

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).

Best Answer

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.

Related Topic