Esempio n. 1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, EdusentContext context)
        {
            if (env.IsDevelopment())
            {
                DbInitializer.InitializeData(context);
                app.UseDeveloperExceptionPage();
                //app.UseBrowserLink();
                app.UseDatabaseErrorPage();
            }
            else
            {
                app.UseHsts();
            }

            app.UseHttpsRedirection();

            app.UseCors(AllowAnywhere);

            app.UseAuthentication();

            app.UseMvc();
        }
Esempio n. 2
0
 protected BaseRepo(DbContextOptions options)
 {
     _db   = new EdusentContext(options);
     table = _db.Set <T>();
 }
Esempio n. 3
0
 protected BaseRepo()
 {
     _db   = new EdusentContext();
     table = _db.Set <T>();
 }
Esempio n. 4
0
 protected BaseRepo(EdusentContext context)
 {
     _db   = context;
     table = _db.Set <T>();
 }
Esempio n. 5
0
 public UserRepo(DbContextOptions <EdusentContext> options, ISubjectRepo subjectRepo)
 {
     Db           = new EdusentContext(options);
     Table        = Db.Set <User>();
     _subjectRepo = subjectRepo;
 }