Should I upgrade to Entity Framework?

I used the class SqlCommandand wrote my own T-SQL queries for a very long time. I am stuck with this because I like it, and this is probably due to the fact that I start as a window designer a few days before we have many other great options. I’ve been doing web development for about 10 years and still use it and write my own query strings. I wrote a dynamic class for all the needs of my database on the fly, all I have to do is write T-SQL, which I can do quickly and use in any project.

Other developers have big eyes when they see my code, and I recommend that I learn LINQ, which I do not like at all.

Now I am starting a new project in ASP.NET MVC, and now I feel that I need to get out of the days of the dinosaurs and go to the Entity Framework to process my data.

I know that the class SqlCommandis the nuts and bolts of the Entity Framework backstage, so I feel why I should go through the average person (entity) in order to achieve the same results and spend time learning something new.

Can someone please explain to me why I need to move on, or should I stick to what I know?

+4
source share
4 answers

, SqlCommand... , ORM, , - . , , , , DataSets, , SQL-, SQL Injection.

EF ( ORM) , SQL, , , .

10 , ?

, EF, ... - , ORM - (, ORM, , dapper ), , .

ADO - .

+4

EF

  • EF , .
  • , , .
  • EF, .

( Linq2SQL) .

EF- .

+4

, , .

. SqlCommand ADO, , .

LinkedIn , . , , , , .

:

, ADO.NET. , ( ) , , . , , - , , , . , , , - Entity Framework, . , ADO, , , .

, , . , ( ). , , , , , , , SSMS , .

, , , T-SQL ( , string.Format -esque, params -style ), , , , EntityFramework.

, , , , , , , EntityFramework . , , , . , , SELECT, , - .

, , , SqlCommand . , .

Edit:

, , . , ORM, , , SqlCommand , , " ", . . , , , ORM , ( , , , XElement, , , Sql - ), EF, , ADO. , .

2:

, - , , ORM. EF , , , .

+1

NHibernate, EntityFramewrk, LinqToSQL SQLCommand . ORM , , sql. , sql . , , , .

We recently started a new project and decided to use the plain old SQLCommand for it with our own Linq to SQL translator. This works well for simple queries, and we can revert to dedicated code for more complex ones. Another thing is that we like to have full control over our database, and, in my opinion, we lose this when using ORM.

+1
source

Source: https://habr.com/ru/post/1548586/


All Articles