Exemplo n.º 1
0
        // 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?}");
            });
        }
Exemplo 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, 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" });
            });
        }
Exemplo n.º 3
0
        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;
 }
Exemplo n.º 5
0
 public IActionResult ActionInject([FromServices] IAppointService appointService)
 {
     ViewData["Message"] = "Scheduled: " + appointService.ScheduleAppoint();
     return(View());
 }
Exemplo n.º 6
0
 public PatientController(IAppointService appointService)
 {
     AppointService = appointService;
 }