我正在尝试在遵循洋葱架构的 ASP.NET MVC 5 解决方案中实现 Identity 2.0。
我有一个ApplicationUser
在我的核心。
namespace Core.DomainModel
{
public class ApplicationUser {...}
}
在我的数据访问层中,我使用的是 Entity Framework 6.1,而我的上下文来源于IdentityDbContext
问题所在。ApplicationUser
需要从Microsoft.AspNet.Identity.EntityFramework.IdentityUser
namespace Infrastructure.DAL
{
public class TestContext : IdentityDbContext<ApplicationUser> {...}
}
我的域模型不应该引用Microsoft.AspNet.Identity.EntityFramework
会违背洋葱的想法。
什么是好的解决方案?