Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

.net core 2.0 hybrid ORM (dapper and entity framework core 2.0)

$
0
0

Dear Friends,

I have started my new project in .Net core 2.0. Recently I did some research for best suited ORM, which is fast and easy to use. I found Dapper as a king of ORM, but it has many limitation. To overcome these limitation I found solution to use hybrid approach by combining Entity framework 2.0 and Dapper. (I did the same approach earlier where I used ADO.Net + EF and it worked best for me).

My major targets are

  1. Use both ORMs as for linq to SQL I will use EF while dapper will be used for data fetching etc. CRUD operation will be written in store procedures
  2. I want to share common db connection between EF and dapper. So that I can manage transactions between these two.
  3. I want generic solution for DB connection. My application can be configured for different database (SQL server, Oracle and mySql).

I am concerned about point 2 and 3. I don't want to follow steps that Microsoft mentioned in EF core 2.0 documentation. In this case I cannot share IDb connection between dapper and EF.

(In my earlier implementation I created class which return IDb connection based on provider type; but it in this case dependency injection is some how difficult for me)


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>