예제 #1
0
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, FanSoftStoreDataContext ctx)
        {
            app.UseStaticFiles();
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                DbInitializer.Init(ctx);
                app.UseNodeModules(env.ContentRootPath);
            }

            app.UseAuthentication();
            app.UseMvcWithDefaultRoute();

            app.Run(async(context) =>
            {
                context.Response.Headers.Add("Content-type", "text/html;charset=utf-8");
                await context.Response.WriteAsync("Recurso não encontrado");
            });
        }
예제 #2
0
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();

                using (var ctx = new FanSoftStoreDataContext())
                {
                    DbInitializer.Init(ctx);
                }
            }

            app.UseMvcWithDefaultRoute();

            app.Run(async(context) =>
            {
                context.Response.Headers.Add("Content-type", "text/html;charset=utf-8");
                await context.Response.WriteAsync("Recurso não encontrado");
            });
        }
예제 #3
0
 public ProdutosController(FanSoftStoreDataContext ctx)
 {
     _ctx = ctx;
 }
예제 #4
0
 public ContaController(FanSoftStoreDataContext ctx)
 {
     _ctx = ctx;
 }