public InvoicesController(SellitContext context)
 {
     // Dependency Injetion
     DbContext = context;
 }
Esempio n. 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, SellitContext context)
        {
            loggerFactory.AddConsole(Configuration.GetSection("Logging"));
            loggerFactory.AddDebug();

            app.UseApplicationInsightsRequestTelemetry();

            app.UseApplicationInsightsExceptionTelemetry();

            // Serve static files (html, css, js, images)
            app.UseStaticFiles();

            DbInitializer.Initialize(context);


            // TinyMapper binding configuration
            TinyMapper.Bind <Contractor, ContractorViewModel>();

            /*
             * //Caching issues
             * app.UseStaticFiles(new StaticFileOptions()
             * {
             *  OnPrepareResponse = (context) =>
             *  {
             *      // Disable caching for all static files.
             *      context.Context.Response.Headers["Cache-Control"] = "no-cache, no-store";
             *  context.Context.Response.Headers["Pragma"] = "no-cache";
             *      context.Context.Response.Headers["Expires"] = "-1";
             *  }
             * });
             */

            // Add MVC to the pipeline
            app.UseMvc();
        }
 public ProductsController(SellitContext context)
 {
     // Dependency Injetion
     DbContext = context;
 }
Esempio n. 4
0
 public ContractorsController(SellitContext context)
 {
     // Dependency Injetion
     DbContext = context;
 }