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
- 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
- I want to share common db connection between EF and dapper. So that I can manage transactions between these two.
- 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)