V
V
Vadim Nikiforov2021-07-21 16:21:00
ASP.NET
Vadim Nikiforov, 2021-07-21 16:21:00

Why can't you just write SQL queries, why use ORM Entity Framwork?

Why can't you just write SQL queries, why use ORM Entity Framwork? The result will be the same

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vasily Bannikov, 2021-07-21
@vabka

Why can't you just write SQL queries

It is possible - there is ADO .net, there is Dapper.
The result will be the same

No Another.
why use an ORM

To write less code than when working with the connector directly.
why use ORM Entity Framework

To write less code, to abstract from the specifics of a particular DBMS, so that all queries are strongly typed.

B
BasiC2k, 2021-07-21
@BasiC2k

Entity Framwork uses the Code-First approach. This means that you first describe the structure of the database using classes, and then do the migration and tables are created in the database according to the described structure. This approach is convenient because you can see in the program code all references to a particular field or database table. In the future, you work with tables as with objects. If changes are needed in the database structure, they are easy to implement.
A regular SQL query can also be used, for example, in conjunction with ADODB. The advantage of this approach can be considered a relatively easy entry threshold. Before inserting into the request code, it can be debugged. This approach allows you to better understand the principles of using SQL and better start with it.
What to use is up to you, depending on the complexity and needs of the project.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question