Our ASP.NET MVC project uses MS SQL Server (for most of the data) and MongoDB (least important stuff like audit logs, internal messaging system, notifications etc.) at the same time. So the question is what should data access layer architecture look like in my case? We are using Entity Framework POCO generator to access SQL Server as unit testing is important and ideally I would prefer to extend an IEntities interface generated by Entity Framework so that business logic and UI developers won't even know where the actual object is stored:
[GeneratedCode("Entity","0.9")]
public partial interface IEntities
{
IObjectSet<Administrator> Administrators { get; }
IObjectSet<User> Users { get; }
IObjectSet<Banner> Banners { get; }
IObjectSet<AuditLog> AuditLogs { get; }
...
}
In this example only AuditLog entities are stored in the MongoDB while the rest of them work through SQL Server.
The best solution I have so far is to implement an IObjectSet<T> interface on top of the MongoDB C# driver with MongoRepository (http://mongorepository.codeplex.com/) project being a half ready solution for my problem. Does anyone know a better approach?