I'm a new developer in ASP.NET MVC. I want to create a Login page for user account in my application. I saw many tutorials that work with Enity Framework but I preferred to work with SQL and now I cant decide to choose which one! Can anyone explain that is it better to use SQL or EF? Any answers can be very helpful.
Thanks
-
2Check this posts: [Entity Framework VS LINQ to SQL VS ADO.NET with stored procedures][1] [1]: stackoverflow.com/questions/2698151/…BizApps– BizApps2012-04-24 23:17:08 +00:00Commented Apr 24, 2012 at 23:17
-
Tena the link you described is a good startkrystan honour– krystan honour2012-04-25 14:57:13 +00:00Commented Apr 25, 2012 at 14:57
1 Answer
Ok so it's a matter of preference,
When you say use EF or sql I take it you mean ADO with sprocs and perhaps dynamic sql. Also there is NHibernate to consider.
Ultimately ORMs like entity framework or NHibernate can save a lot of the heavy lifting and repetative code associated with traditional database methods (like ADO) they are themselves are using that technology to execute in somecases.
The ORMs provide an abstraction that makes things easier to work with for developers because you are working with objects and not datasets (which traditionally Devs find harder to work with if they are from an O-O background).
This technology however has its own learning curve. I would suggest you take a look at implementing the code and perhaps just use plain SQL for now if you are not confident with the other technology and implement your feature.
Once you have it working and are happy the other MVC stuff works right you could perhaps refactor the code to use EF. Its really going to be dependant on how much you want to use.
Personally I like using ORMS over stored procedures for Most querys (especially CRUD operations) but some people swear by sprocs and sql. In reality most applications will use both as sprocs have advantages when it comes to bulk operations.
What is more important than the implementation tech used for the data layer is , that the data layer is well designed