예제 #1
0
파일: Program.cs 프로젝트: gl-dn/MySkyEng
        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();
        }
예제 #2
0
 public UnitOfWork(MySkyEngDbContext context)
 {
     this.context = context ?? throw new ArgumentNullException(nameof(context));
 }
예제 #3
0
 public TeacherRepository(MySkyEngDbContext context) : base(context)
 {
 }
예제 #4
0
 public StudentRepository(MySkyEngDbContext context) : base(context)
 {
 }
예제 #5
0
 public PersonRepository(MySkyEngDbContext context) : base(context)
 {
 }
예제 #6
0
 public EmployeeRepository(MySkyEngDbContext context) : base(context)
 {
 }
예제 #7
0
 public Repository(MySkyEngDbContext context)
 {
     this.context = context ?? throw new ArgumentNullException(nameof(context));
 }