public static MyRoleManager Create(IdentityFactoryOptions <MyRoleManager> options, IOwinContext context) { OwinApiContext dbContext = context.Get <OwinApiContext>(); RoleStore <AppRole> roleStore = new RoleStore <AppRole>(dbContext); var manager = new MyRoleManager(roleStore); return(manager); }
public static MyUserManager Create(IdentityFactoryOptions <MyUserManager> options, IOwinContext context) { OwinApiContext dbContext = context.Get <OwinApiContext>(); UserStore <AppUser> userStore = new UserStore <AppUser>(dbContext); var manager = new MyUserManager(userStore); return(manager); }
public BotController() { _htmlWeb = new HtmlWeb() { AutoDetectEncoding = false, OverrideEncoding = Encoding.UTF8, //Set UTF8 để hiển thị tiếng Việt PreRequest = request => { //support GZip // Make any changes to the request object that will be used. request.AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip; return(true); } }; _db = new OwinApiContext(); }
public CategoryController() { _db = new OwinApiContext(); }
public AccountController() { _userManager = HttpContext.Current.GetOwinContext().Get <MyUserManager>(); _roleManager = HttpContext.Current.GetOwinContext().Get <MyRoleManager>(); _db = new OwinApiContext(); }
public CrawlerConfigController() { _db = new OwinApiContext(); }