I want to create abstract layer between entity framework and Dapper.In runtime i can choose either entity framework or Dapper or i will both of them also. I know that i can use interface
public IORM{
Save();
Delete();
//other ORM functions
}
public EntityFramework : IORM{
public Save(){
SaveChanges();
}
public Delete(){
Remove();
}
}
public Dapper: IORM{
public Save(){
//save code goes here
}
public Delete(){
//delete code goes here
}
But this is basic operations and not sure how to configure in .net core 2.0 CofigureServices() Method.
Is abstractions between different ORMs advisable? If yes how to implement abstract layer between Entity framework and Dapper in .net core 2.0?