Пример #1
0
        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);
        }
Пример #2
0
        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();
 }
Пример #4
0
 public CategoryController()
 {
     _db = new OwinApiContext();
 }
Пример #5
0
 public AccountController()
 {
     _userManager = HttpContext.Current.GetOwinContext().Get <MyUserManager>();
     _roleManager = HttpContext.Current.GetOwinContext().Get <MyRoleManager>();
     _db          = new OwinApiContext();
 }
 public CrawlerConfigController()
 {
     _db = new OwinApiContext();
 }