Ejemplo n.º 1
0
        public HomeController(IMapper mapper, ICalendarAPI api)
        {
            _mapper = mapper;
            _api    = api;

            var calendars = _api.GetCalendars();

            for (int i = 0; i < calendars.Result.Count; i++)
            {
                courts.Add(calendars.Result[i].Id, calendars.Result[i].Summary);
            }
        }
Ejemplo 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, IServiceProvider services, UserManager <IdentityUser> userManager, RoleManager <IdentityRole> roleManager, ICalendarAPI calendarApi)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseDatabaseErrorPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }


            app.UseHttpsRedirection();
            app.UseStaticFiles();
            app.UseCookiePolicy();

            app.UseAuthentication();
            RoleInitializer.InitializeAsync(userManager, roleManager).Wait();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });
        }
Ejemplo n.º 3
0
 public EventsController(IMapper mapper, ApplicationDbContext context, ICalendarAPI api)
 {
     _mapper  = mapper;
     _context = context;
     _api     = api;
 }
Ejemplo n.º 4
0
 public CourtsController(IMapper mapper, ICalendarAPI api)
 {
     _mapper = mapper;
     _api    = api;
 }