public UserService(UserManager <User> userManager, SignInManager <User> signInManager, IConfiguration configuration, CakeShopDbContext cakeShopDbContext) { _userManager = userManager; _signInManager = signInManager; _configuration = configuration; _cakeShopDbContext = cakeShopDbContext; }
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(); }
public ProductService(CakeShopDbContext context) { _context = context; }