Example #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, TxtXContext 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();
        }
 public UserRepo(DbContextOptions <TxtXContext> options)
 {
     Db    = new TxtXContext(options);
     Table = Db.Set <User>();
 }
Example #3
0
 protected BaseRepo(TxtXContext context)
 {
     _db   = context;
     table = _db.Set <T>();
 }
Example #4
0
 protected BaseRepo(DbContextOptions options)
 {
     _db   = new TxtXContext(options);
     table = _db.Set <T>();
 }
Example #5
0
 protected BaseRepo()
 {
     _db   = new TxtXContext();
     table = _db.Set <T>();
 }