コード例 #1
0
        public AuthRepository()
        {
            _ctx = new ThegioistickerEntities();
            //var provider = new DpapiDataProtectionProvider("Thegioisticker");
            _userManager = new UserManager <ApplicationUser>(new UserStore <ApplicationUser>(_ctx));
            var provider = new DpapiDataProtectionProvider("YourAppName");

            _userManager.UserTokenProvider = new DataProtectorTokenProvider <ApplicationUser, string>(provider.Create("UserToken"))
                                             as IUserTokenProvider <ApplicationUser, string>;
            _roleManager = new RoleManager <IdentityRole>(new RoleStore <IdentityRole>(_ctx));
        }
コード例 #2
0
 public ThegioistickerEntities Init()
 {
     return(dbContext ?? (dbContext = new ThegioistickerEntities()));
 }