Click here to Skip to main content
15,886,017 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
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)

What I have tried:


[^]

Dapper in .Net core 2.0
Posted
Updated 30-Apr-18 17:54pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900