Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which ORM will give me compile-tested queries?

Tags:

c#

.net

orm

Which ORM will give me compile-tested queries?

Is linqtosql compile time tested?


Edit:

Say I write a query that references a column named 'TotalSales'. I then rename the column in my database to TotalSales2 (and any other config file like: Employee.cfg.xml in nHibernate).
When I compile the project, I want Visual Studio to tell me the column 'totalSales' doesn't exist and then I will go and change it.

like image 269
Blankman Avatar asked Dec 30 '22 23:12

Blankman


2 Answers

There aren't any as far as I'm aware. They will often let you create a LINQ query that cannot be translated into SQL for example. Also, I am not aware of any compile time checking that your mappings map to your database correctly.

You can, and should in my opinion, perform all these checks within tests. Most ORMs make this easy to do.

like image 169
Garry Shutler Avatar answered Jan 14 '23 15:01

Garry Shutler


I use LLBLGen but it has to be "refreshed" when data model changes are made. I don't think you'll get an ORM that will AT COMPILE TIME check for modifications against the database. You're asking for quite a bit there.

like image 37
Nick DeVore Avatar answered Jan 14 '23 14:01

Nick DeVore