public static void Main(string[] args) { IWebHost host = CreateWebHostBuilder(args).Build(); IHostingEnvironment env = host.Services.GetService <IHostingEnvironment>(); using (IServiceScope scope = host.Services.CreateScope()) { var services = scope.ServiceProvider; try { MySkyEngDbContext Context = services.GetRequiredService <MySkyEngDbContext>(); Context.Database.EnsureCreated(); //DataDbInitializer.Seed(Context); } catch (Exception ex) { ILogger <Program> logger = services.GetRequiredService <ILogger <Program> >(); logger.LogError(ex, "An error occurred while seeding the database."); } } host.Run(); }
public UnitOfWork(MySkyEngDbContext context) { this.context = context ?? throw new ArgumentNullException(nameof(context)); }
public TeacherRepository(MySkyEngDbContext context) : base(context) { }
public StudentRepository(MySkyEngDbContext context) : base(context) { }
public PersonRepository(MySkyEngDbContext context) : base(context) { }
public EmployeeRepository(MySkyEngDbContext context) : base(context) { }
public Repository(MySkyEngDbContext context) { this.context = context ?? throw new ArgumentNullException(nameof(context)); }