Ejemplo n.º 1
0
 public UserService(UserManager <User> userManager, SignInManager <User> signInManager, IConfiguration configuration, CakeShopDbContext cakeShopDbContext)
 {
     _userManager       = userManager;
     _signInManager     = signInManager;
     _configuration     = configuration;
     _cakeShopDbContext = cakeShopDbContext;
 }
Ejemplo n.º 2
0
        public static async Task Main(string[] args)
        {
            var host = BuildWebHost(args);

            using (var scope = host.Services.CreateScope())
            {
                context     = scope.ServiceProvider.GetRequiredService <CakeShopDbContext>();
                usermanger  = scope.ServiceProvider.GetRequiredService <UserManager <IdentityUser> >();
                roleManager = scope.ServiceProvider.GetRequiredService <RoleManager <IdentityRole> >();
                env         = scope.ServiceProvider.GetRequiredService <IConfiguration>();

                await DbInitializer.SeedDatabaseAsync(context, usermanger, roleManager, env);
            }

            host.Run();
        }
Ejemplo n.º 3
0
 public ProductService(CakeShopDbContext context)
 {
     _context = context;
 }