EntityFramework 6 和 mongodb 和身份
EntityFramework 6 and mongodb and Identity
我正在使用 WebAPI 项目,我想用 Mongodb.
设置 EntityFramework 6
我已经按照以下 link:
设置了我的 mongodb 数据库和我的 entity framework 代码优先模型
http://cdn.rssbus.com/help/DG1/ado/pg_efCodeFirst.htm
现在我想让 Entity Framework 和 Asp.net Identity 2 基于 Mongodb 一起工作。但是,我找不到任何允许这样做的方法或模块。我找到了以下内容,但它解释了卸载 entity framework。
https://github.com/g0t4/aspnet-identity-mongo
那么您知道教程吗?或者您有任何经验可以先为 EF Code 启用 mongodb 并使用 IDentity 吗?
谢谢,
好的,所以我终于找到了解决方案。
我不再使用 EF。
我正在将 AspNet Identity Mongo 与我编译的 V2 分支一起使用。
https://github.com/InspectorIT/MongoDB.AspNet.Identity/tree/v2
我正在使用 MongoRepository 作为我的模型的存储库。
https://github.com/RobThree/MongoRepository
并且我开发了一个数据服务来管理我的模型 CRUD 操作。
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; } }
}
而且我很好
谢谢,
我正在使用 WebAPI 项目,我想用 Mongodb.
设置 EntityFramework 6我已经按照以下 link:
设置了我的 mongodb 数据库和我的 entity framework 代码优先模型http://cdn.rssbus.com/help/DG1/ado/pg_efCodeFirst.htm
现在我想让 Entity Framework 和 Asp.net Identity 2 基于 Mongodb 一起工作。但是,我找不到任何允许这样做的方法或模块。我找到了以下内容,但它解释了卸载 entity framework。
https://github.com/g0t4/aspnet-identity-mongo
那么您知道教程吗?或者您有任何经验可以先为 EF Code 启用 mongodb 并使用 IDentity 吗?
谢谢,
好的,所以我终于找到了解决方案。
我不再使用 EF。
我正在将 AspNet Identity Mongo 与我编译的 V2 分支一起使用。
https://github.com/InspectorIT/MongoDB.AspNet.Identity/tree/v2
我正在使用 MongoRepository 作为我的模型的存储库。
https://github.com/RobThree/MongoRepository
并且我开发了一个数据服务来管理我的模型 CRUD 操作。
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; } }
}
而且我很好
谢谢,