我正在努力复制2.0.x beta包的ASP.NET Identity样本,因为我无法创建类型化的UserManager。代码 -
public class ApplicationUserManager : UserManager<ApplicationUser, int>
{
public ApplicationUserManager(IUserStore<ApplicationUser, int> store) : base(store)
{
}
public static ApplicationUserManager Create(IdentityFactoryOptions<ApplicationUserManager> options)
{
var manager = new ApplicationUserManager(new UserStore<ApplicationUser>(options.Context as ApplicationIdentityDbContext));
不会编译,因为IdentityFactoryOptions类似乎不包含符号“Context”。
当我在对象浏览器中检查类时,它包含以下属性 -
public Microsoft.Owin.IOwinContext Context { set; get; }
Member of Microsoft.AspNet.Identity.Owin.IdentityFactoryOptions<T>
public Microsoft.Owin.Security.DataProtection.IDataProtectionProvider DataProtectionProvider { set; get; }
Member of Microsoft.AspNet.Identity.Owin.IdentityFactoryOptions<T>
public Microsoft.AspNet.Identity.Owin.IIdentityFactoryProvider<T> Provider { set; get; }
Member of Microsoft.AspNet.Identity.Owin.IdentityFactoryOptions<T>
我可以查看并使用“DataProtectionProvider”和“Provider”属性。鉴于所有三个都有相同的访问修饰符,是什么阻止我看到和使用“上下文”属性,我需要做什么才能使ASP.NET身份示例与当前的包测试版一起使用?
包版本 -
<package id="Microsoft.AspNet.Identity.Core" version="2.0.0-beta1-140211" targetFramework="net45" />
<package id="Microsoft.AspNet.Identity.EntityFramework" version="2.0.0-beta1-140211" targetFramework="net45" />
<package id="Microsoft.AspNet.Identity.Owin" version="2.0.0-beta1-140211" targetFramework="net45" />
<package id="Microsoft.Owin" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.Owin.Host.SystemWeb" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.Owin.Security" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.Owin.Security.Cookies" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.Owin.Security.OAuth" version="2.1.0" targetFramework="net45" />
<package id="Owin" version="1.0" targetFramework="net45" />