Search code examples
entity-frameworkado.net

Is there any alternative for ADO.net & EFW?


I have been working on ADO.net majorly and on EFW for sometime on one project. I am going to Work on a new project and getting confused on choosing the DB layer. I have read some articles on performance of ADO.net and EFW. EFW is slower than ADO. So, I would like to choose the best one for my project. I know that, ADO.net implementation requires write more code. So, I am looking for more performance and less coding. Please suggest me for the alternative to ADO.net and EFW if exists, if not please suggest the best one between them.

Little info on project:

Project description: its going to be a single page application and data will be saved for a user on date wise. Need to fetch the data for the selected date.

IDE : VS2017 Framework: Latest version of the framework. Database: MS Sqlserver 2014 Service layer: WebAPi UI : Angular 6 with typescript.


Solution

  • Choosing the best option depends on the project at hand.

    If you have a complex domain model, a full blown O/R mapper like Entity Framework or NHibernate might be a good option. Entity Framework and NHibernate come with a steep learning curve. Using such a tool also requires you to know what is going on behind the scenes if you want to have a performant application.

    There exist also micro O/R mappers like Dapper, PetaPoco, etc... which have their use-cases as well. (I believe Stackoverflow uses Dapper).

    If you have full control yourself, then you'll have to give up on the abstraction-layer that an O/R tool (be it fullblown or micro) provides. Then you use plain ADO.NET yourself. (The O/R tools use ADO.NET behind the scenes). Using ADO.NET directly will give you more work. Either way you'll use it directly which will make it harder for you to maintain, or you create a little data-access-layer yourself as a layer of abstraction to get more readable code.

    It's entirely up to you, but the cases in where I'd advise to use ADO.NET directly are very small.
    If you do not need a full blown O/R mapper, I would look at one of the micro-ORM's that are available for .NET