public ProductRepository(SIMSDbContext context)
 {
     _context = context;
 }
Beispiel #2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, SIMSDbContext db)
        {
            loggerFactory.AddConsole(Configuration.GetSection("Logging"));
            // loggerFactory.AddDebug();
            loggerFactory.AddFile("Logs/SIMS-{Date}.txt");

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions
                {
                    HotModuleReplacement = true
                });
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }
            app.UseTokenMiddlewareExtensions();

            app.UseStaticFiles();


            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller}/{action}/{id?}");
                routes.MapRoute(
                    name: "api",
                    template: "api/{controller}/{action}/{id?}");
                routes.MapSpaFallbackRoute(
                    name: "spa-fallback",
                    defaults: new { controller = "Home", action = "Index" });
            });
            InitDb.Init(db);
        }
Beispiel #3
0
 public UsersService(IConfiguration configuration, SIMSDbContext db)
 {
     this.configuration = configuration;
     this.dbContext     = db;
 }
Beispiel #4
0
 public AccountRepository(SIMSDbContext context)
 {
     _context = context;
 }
Beispiel #5
0
 public RoleRepository(SIMSDbContext context)
 {
     _context = context;
 }
Beispiel #6
0
 public CategoryRepository(SIMSDbContext context)
 {
     _context = context;
 }