EntityFramework 6 and mongodb and Identity

I am using a WebAPi project and I would like to configure EntityFramework 6 with Mongodb.

I installed my mongodb database and my first entity code model by following this link:

http://cdn.rssbus.com/help/DG1/ado/pg_efCodeFirst.htm

Now I would like the Entity Framework and Asp.net Identity 2 to work together based on Mongodb. However, I can’t find any ways to do this. I found the following, but explains how to remove an entity structure.

https://github.com/g0t4/aspnet-identity-mongo

Do you know what you know, or do you have experience to first enable mongodb for EF Code and with IDentity working with?

thanking

+5
source share
1 answer

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,

+7
source

All Articles