// 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, IDiscountChecker discountChecker) { loggerFactory.AddConsole(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler(new ExceptionHandlerOptions { ExceptionHandler = context => context.Response.WriteAsync( "<h1 style=\"text-align: center;\">Opps! Some unexpected error occured!</h1>") }); } app.UseFileServer(); app.UseNodeModules(env.ContentRootPath); app.UseIdentity(); app.UseMvc(routProvider => routProvider.MapRoute("Default", "{controller=home}/{action=index}/{id?}")); }
public HomeController(IPhonesData phonesData, IDiscountChecker discountChecker) { _phonesData = phonesData; _discountChecker = discountChecker; }
public DiscountViewComponent(IDiscountChecker discountChecker) { _discountChecker = discountChecker; }