public static void Initialize(IServiceProvider serviceProvider) { using (var context = new OrgDocsContext( serviceProvider.GetRequiredService <DbContextOptions <OrgDocsContext> >())) { if (context.Categories.Any()) { return; } context.Categories.AddRange( new Category { Name = "Procedure" }, new Category { Name = "Policy" }, new Category { Name = "Downtime" }, new Category { Name = "Contact" } ); context.SaveChanges(); } }
public DeptsController(OrgDocsContext context) { _context = context; }
public CategoriesController(OrgDocsContext context) { _context = context; }
public UserController(OrgDocsContext context, UserManager <IdentityUser> userManager) { _context = context; _userManager = userManager; }