I
I
iscateli2021-06-17 15:01:37
C++ / C#
iscateli, 2021-06-17 15:01:37

Is there a database first ORM for .NET?

Is there a stable, well-tested lightweight ORM for .NET that focuses on the so-called "Database first" approach that supports building arbitrary SQL queries manually. For example, I found the Dapper project, it seems to be suitable, but what if there are some more? Is it possible to work like this in Entity Framework Core?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2021-06-17
@iscateli

For example, I found the Dapper project, it seems to be suitable, but what if there are some more?

There is LinqToDb - it is focused on working with Linq, but at the same time fast and lightweight (comparable to dapper).
At the same time, almost all SQL can be expressed in linq, including window functions and CTEs, unlike EF Core.
There is a code generator for an existing base based on T4.
You can also call raw SQL, but a dapper is better for this.
Is it possible to work like this in Entity Framework Core?

Yes. You can generate a context on an already existing database using the
dotnet ef dbcontext scaffold
Raw SQL command can be called using FromSqlInterpolated

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question