So, I finally found a solution.
I no longer use EF.
I am using AspNet Identity Mongo with a V2 branch that I compiled.
https://github.com/InspectorIT/MongoDB.AspNet.Identity/tree/v2
I am using MongoRepository for the repository of my model.
https://github.com/RobThree/MongoRepository
And I developed a DataService to manage my CRUD operations.
public class DataService { public static MongoRepository<ModelClass> ModelClass{ get { return Singleton<MongoRepository<ModelClass>>.Instance; } } } public class Singleton<T> where T : class, new() { Singleton() { } private static readonly Lazy<T> instance = new Lazy<T>(() => new T()); public static T Instance { get { return instance.Value; } } }
And I'm good.
Thanks,
source share