can anyone tell me what is the benefit to use entity framework and linq than to use traditional ado.net plus sql store proecdure way in the application?
Perrsonally I think there is a lot. First I am a big fan of code-first. Its great writing your c# and Linq and not worrying about the mappings, or casting in-out of the DB. If you have some strict concerns over your DB tables you can use attribute annotations
for added control. It gives you a ton of flexibility later if you want to deploy your data access layer as a web API. Its compliments MVC's seperaton of concerns. I find it easier to create a class library consisting of all your business objects, your DbContext,
and an Object repository for each of your dbsets. Then you can just instanciate your repository classes to interact with all your data objects. This may be debated by some but I think EF allows for a much faster and more flexible work-flow.
Hope it hepls!
Doers get what they want! Everyone else gets what they get.
All in all, compared with the traditional ADO.NET,linq or EF will let you do programming to cope with data's CRUD just like you are controlling with classes (called OOP programming).
And it's widely used in MVC frame, as well as a lot of other situations.
yangwulong19...
Member
20 Points
114 Posts
hat is the benefit to use entity framework and linq than to use traditional ado.net plus sql sto...
Dec 03, 2012 11:54 PM|LINK
Iam learning entity framework, and LINQ to SQL,
can anyone tell me what is the benefit to use entity framework and linq than to use traditional ado.net plus sql store proecdure way in the application?
tdykstra
Contributor
4523 Points
630 Posts
Microsoft
Moderator
Re: hat is the benefit to use entity framework and linq than to use traditional ado.net plus sql...
Dec 04, 2012 01:23 AM|LINK
See the ORM and LINQ sections in this MSDN page:
http://msdn.microsoft.com/en-us/library/ms178359.aspx#orm
remojr76
Participant
902 Points
303 Posts
Re: hat is the benefit to use entity framework and linq than to use traditional ado.net plus sql...
Dec 04, 2012 01:24 AM|LINK
Perrsonally I think there is a lot. First I am a big fan of code-first. Its great writing your c# and Linq and not worrying about the mappings, or casting in-out of the DB. If you have some strict concerns over your DB tables you can use attribute annotations for added control. It gives you a ton of flexibility later if you want to deploy your data access layer as a web API. Its compliments MVC's seperaton of concerns. I find it easier to create a class library consisting of all your business objects, your DbContext, and an Object repository for each of your dbsets. Then you can just instanciate your repository classes to interact with all your data objects. This may be debated by some but I think EF allows for a much faster and more flexible work-flow.
Hope it hepls!
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: hat is the benefit to use entity framework and linq than to use traditional ado.net plus sql...
Dec 05, 2012 12:55 AM|LINK
Hello,
All in all, compared with the traditional ADO.NET,linq or EF will let you do programming to cope with data's CRUD just like you are controlling with classes (called OOP programming).
And it's widely used in MVC frame, as well as a lot of other situations.
yangwulong19...
Member
20 Points
114 Posts
Re: hat is the benefit to use entity framework and linq than to use traditional ado.net plus sql...
Dec 05, 2012 01:38 AM|LINK
do if I used entity framework and LINQ, we no need to use store procedure any more ,right? as now, our traditiaonal project, all use store procedure.
thaicarrot
Contributor
5431 Points
1507 Posts
Re: hat is the benefit to use entity framework and linq than to use traditional ado.net plus sql...
Dec 05, 2012 03:36 AM|LINK
Stored procedule is compile code and faster. However, there's con and pro between stored procedule and Linq to Entities.
There's new kind of Stored Procedule. It is Table-Valued Fjunction.
http://msdn.microsoft.com/en-us/data/ee712907
Weera
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: hat is the benefit to use entity framework and linq than to use traditional ado.net plus sql...
Dec 05, 2012 04:06 AM|LINK
No. Not so absolute.
You can mix using them if you need.
yangwulong19...
Member
20 Points
114 Posts
Re: hat is the benefit to use entity framework and linq than to use traditional ado.net plus sql...
Dec 05, 2012 04:12 AM|LINK
is there any general guide which time to use which technology?
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: hat is the benefit to use entity framework and linq than to use traditional ado.net plus sql...
Dec 05, 2012 04:13 AM|LINK
Just depends, it's a technology that if you wanna use, you can apply that;D