public static async Task InitializeAsync(GustoDbContext context, IServiceProvider serviceProvider) { var RoleManager = serviceProvider.GetRequiredService <RoleManager <IdentityRole> >(); string[] roleNames = { "Admin", "Chef", "User" }; IdentityResult roleResult; foreach (var roleName in roleNames) { var roleExist = await RoleManager.RoleExistsAsync(roleName); if (!roleExist) { roleResult = await RoleManager.CreateAsync(new IdentityRole(roleName)); } } //var UserManager = serviceProvider.GetRequiredService <UserManager<User>>(); //var SignInManager = serviceProvider.GetRequiredService<SignInManager<User>>(); //if (!await UserManager.GetUserName([email protected])) { } // var user = new User() //{ // UserName = "******", // Email = "*****@*****.**", // LastName = "jeff", // FirstMidName = "test" //}; //await UserManager.AddToRoleAsync(user, "User"); //await SignInManager.SignInAsync(user, isPersistent: false); }
public BaseController(GustoDbContext context) { _context = context; }
public RecettesController(GustoDbContext context) : base(context) { }
public EtapesController(GustoDbContext context) : base(context) { }
public CategoriesController(GustoDbContext context) : base(context) { }
public AvisController(GustoDbContext context) : base(context) { }
public DashboardController(GustoDbContext context) : base(context) { }
public NotesController(GustoDbContext context) : base(context) { }
public ComposersController(GustoDbContext context) : base(context) { }
public FavorisController(GustoDbContext context) : base(context) { }
public RecettesController(GustoDbContext context) { _context = context; }
public IngredientsController(GustoDbContext context) : base(context) { }
public HomeController(GustoDbContext context) : base(context) { }