// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, src.IUpdateNews updateNews, src.IUpdateDB updateDB) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseStaticFiles(); app.UseMvc(e => { e.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); app.UseAuthentication(); updateDB.UpdateDb(updateNews.Update()); }
public HomeController(ModelNewsContext DbContext, src.IUpdateNews updateNews, src.IUpdateDB dB) { update = updateNews; Db = DbContext; updateDB = dB; }