public TenantAllowedOriginsRepository(
     AppIdentityContext context,
     ILogger <TenantAllowedOriginsRepository> logger)
 {
     _context = context;
     _logger  = logger;
 }
Example #2
0
 public UsuarioController(AppIdentityContext appIdentityContext,
                          UserManager <AppIdentityUser> userManager, RoleManager <IdentityRole> roleManager)
 {
     this.userManager        = userManager;
     this.roleManager        = roleManager;
     this.appIdentityContext = appIdentityContext;
 }
Example #3
0
 public AccountController(UserManager <AppUser> userManager, AppIdentityContext context, SignInManager <AppUser> signManager)
 {
     UserManager = userManager;
     //RoleManager = roleManager;
     IdentityContext = context;
     SignManager     = signManager;
 }
Example #4
0
 public AuthRepository(AppIdentityContext context,
                       IMapper mapper,
                       UserManager <TenantUserEntity> userManager)
 {
     _context     = context;
     _mapper      = mapper;
     _userManager = userManager;
 }
Example #5
0
 public UsersRepository(AppIdentityContext context,
                        IMapper mapper,
                        ILogger <UsersRepository> logger)
 {
     _context = context;
     _mapper  = mapper;
     _logger  = logger;
 }
Example #6
0
 public TenantProviderSettingsRepository(AppIdentityContext context,
                                         IMapper mapper,
                                         ILogger <TenantProviderSettingsRepository> logger)
 {
     _context = context;
     _mapper  = mapper;
     _logger  = logger;
 }
 public TenantApplicationsRepository(
     AppIdentityContext context,
     IMapper mapper,
     ILogger <TenantApplicationsRepository> logger)
 {
     _context = context;
     _mapper  = mapper;
     _logger  = logger;
 }
Example #8
0
        public void InitDatabase()
        {
            AppIdentityContext context = new AppIdentityContext();
            string             sql     = context.Database.GenerateCreateScript();
            FileStream         fs      = File.Create(@"e:/identity_Mysql.sql");
            StreamWriter       sw      = new StreamWriter(fs);

            sw.WriteLine(sql);

            sw.Close();
            fs.Close();
            //bool mark = context.Database.EnsureCreated();
            Assert.AreEqual(sql.Length > 0, true);
        }
Example #9
0
        private static async Task CreateSesshin(ProductContext productContext, AppIdentityContext identityContext)
        {
            AppUser chef    = identityContext.Users.FirstOrDefault(usr => usr.Email == "*****@*****.**");
            Sesshin newYear = new Sesshin {
                AppUserId = chef.Id, Name = "New Year 2019", Description = "Until the end of the night!!!", StartDate = new DateTime(2019, 12, 28), EndDate = new DateTime(2020, 01, 01), NumberOfPeople = 90
            };

            //Create the genmai food that will be used after
            await AddGenMaiFood(productContext);

            SesshinService sesshinService = new SesshinService(new EFSesshinRepository(productContext), new EFFoodRepository(productContext), new EFDayOfSesshinRepository(productContext), new UnitOfWork(productContext));
            await sesshinService.CreateAsync(newYear);

            //Add Food For Sesshins
            await CreateNewYearMeal(newYear, productContext);
        }
Example #10
0
 public static void EnsurePopulated(
     AppIdentityContext dbContext,
     RoleManager <IdentityRole> roleManager,
     UserManager <AppUser> userManager)
 {
     // Create default Users (if there are none)
     if (!dbContext.Users.Any())
     {
         CreateRoles(roleManager)
         .GetAwaiter()
         .GetResult();
         CreateUsers(userManager)
         .GetAwaiter()
         .GetResult();
     }
 }
Example #11
0
 public AuthenticationController(
     UserManager <AppUser> userManager,
     RoleManager <IdentityRole> roleManager,
     SignInManager <AppUser> signInManager,
     IConfiguration config,
     AppIdentityContext appIdentityContext,
     IEmailSender sender)
 {
     this.userManager        = userManager;
     this.roleManager        = roleManager;
     this.signInManager      = signInManager;
     this.config             = config;
     this.appIdentityContext = appIdentityContext;
     this.sender             = sender;
     this.key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(config["JWT:Key"]));
 }
Example #12
0
        public void EnsurePopulated(IApplicationBuilder app)
        {
            AppIdentityContext context = app.ApplicationServices.CreateScope().ServiceProvider.GetRequiredService <AppIdentityContext>();

            if (context.Database.GetPendingMigrations().Any())
            {
                context.Database.Migrate();
            }

            UserManager <AppUser>      userManager = app.ApplicationServices.CreateScope().ServiceProvider.GetRequiredService <UserManager <AppUser> >();
            RoleManager <IdentityRole> roleManager = app.ApplicationServices.CreateScope().ServiceProvider.GetRequiredService <RoleManager <IdentityRole> >();

            EnsurePopulatedUsers(userManager);
            EnsurePopulatedRoles(roleManager);
            EnsurePopulatedUserRoles(userManager);
            EnsurePopulatedUsersClaim(userManager);
        }
Example #13
0
 public static void EnsurePopulated(
     ProductContext productContext,
     AppIdentityContext identityContext)
 {
     if (!productContext.Product.Any())
     {
         CreateProducts(productContext)
         .GetAwaiter()
         .GetResult();
     }
     if (!productContext.Sesshin.Any())
     {
         CreateSesshin(productContext, identityContext)
         .GetAwaiter()
         .GetResult();
     }
 }
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env,
                              AppIdentityContext identityContext, Base2BaseWebContext base2BaseWebContext, b2b_testContext b2B_TestContext,
                              UserManager <AppUser> userManager, RoleManager <AppRole> roleManager, IOptions <AdminSettings> options)
        {
            if (env.IsDevelopment())
            {
                app.UseBrowserLink();
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseBrowserLink();
                app.UseDeveloperExceptionPage();

                //app.UseExceptionHandler("/Home/Error");
            }

            app.UseStaticFiles();

            // Apply migrations
            AppIdentityContextInitializer.Initialize(identityContext, userManager, roleManager, options);
            Base2BaseWebContextInitializer.Initialize(base2BaseWebContext);
            b2b_testContextInitializer.Initialize(b2B_TestContext);
            //b2b_testContextInitializer.BypassInitialMigration(b2B_TestContext);

            app.UseAuthentication();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "areas",
                    template: "{area:exists}/{controller=Home}/{action=Index}/{id?}");
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });
        }
Example #15
0
 public EFAccountRepository(AppIdentityContext identityContext)
 {
     _identityContext = identityContext;
 }
 public RefreshTokenRepository(AppIdentityContext context)
 {
     _context = context;
 }
 public IdentityContextInitializeService(IAppIdentityContext context)
 {
     this._context = context as AppIdentityContext;
 }
Example #18
0
 public LoggingService(IAppIdentityContext identityContext)
 {
     this._identityContext = identityContext as AppIdentityContext;
 }
 public UsersController(TechnicalAdvisorContext context, AppIdentityContext appIdentityContext, UserService userService)
 {
     _context            = context;
     _appIdentityContext = appIdentityContext;
     _userService        = userService;
 }
Example #20
0
 public DbInitializer(AppIdentityContext context)
 {
     this._context = context;
 }
 public static void Initialize(AppIdentityContext context)
 {
     context.Database.EnsureDeleted();
     context.Database.EnsureCreated();
 }
Example #22
0
 public virtual void EnsureDatabaseCreated(AppIdentityContext dbContext)
 {
     // run Migrations
     dbContext.Database.Migrate();
 }
 public SeedingService(TechnicalAdvisorContext context, AppIdentityContext appIdentityContext, UserManager <AppIdentityUser> userManager)
 {
     _context            = context;
     _appIdentityContext = appIdentityContext;
     _userManager        = userManager;
 }
Example #24
0
 public AvatarRepository(AppIdentityContext context)
 {
     _context = context;
 }
Example #25
0
 public static async Task Trasjh(AppIdentityContext context, UserManager <AppIdentityUser> userManager,
                                 RoleManager <IdentityRole> roleManager)
 {
     await roleManager.CreateAsync(new IdentityRole("Chad"));
 }
Example #26
0
 public override void EnsureDatabaseCreated(AppIdentityContext dbContext)
 {
     dbContext.Database.OpenConnection();
     dbContext.Database.EnsureCreated();
 }