// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, IAppointService appSvc, IProfileService profSvc) { app.UseHangfireDashboard(); RecurringJob.AddOrUpdate(() => appSvc.GetAppointments(), "0 0 * * *"); app.UseHangfireServer(); if (env.IsDevelopment()) { app.UseBrowserLink(); app.UseDeveloperExceptionPage(); app.UseDatabaseErrorPage(); } else { app.UseExceptionHandler("/Home/Error"); } app.UseCors(options => options.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod().AllowCredentials()); app.UseSession(); app.UseStaticFiles(); app.UseAuthentication(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, IAppointService appSvc, IProfileService profSvc) { //Hangfire jobs app.UseHangfireDashboard(); RecurringJob.AddOrUpdate(() => appSvc.GetAppointments(), "0 0 * * *"); app.UseHangfireServer(); if (env.IsDevelopment()) { app.UseBrowserLink(); app.UseDeveloperExceptionPage(); app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions { HotModuleReplacement = true }); } else { app.UseExceptionHandler("/Home/Error"); } app.UseStaticFiles(); app.UseAuthentication(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); routes.MapSpaFallbackRoute( name: "spa-fallback", defaults: new { controller = "Home", action = "Index" }); }); }
public AccountController( UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager, IEmailSender emailSender, IConfiguration configuration, IHostingEnvironment env, IAppointService Service, ILogger <AccountController> logger) { _userManager = userManager; _signInManager = signInManager; _emailSender = emailSender; _logger = logger; _svc = Service; Configuration = configuration; var builder = new ConfigurationBuilder(); if (env.IsDevelopment()) { builder.AddUserSecrets <AccountController>(); } Configuration = builder.Build(); }
public AppointController(UserManager <ApplicationUser> manager, IAppointService Svc, IProfileService Service) { _manager = manager; _svc = Svc; _service = Service; }
public IActionResult ActionInject([FromServices] IAppointService appointService) { ViewData["Message"] = "Scheduled: " + appointService.ScheduleAppoint(); return(View()); }
public PatientController(IAppointService appointService) { AppointService = appointService; }