// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, PollsContext context) { app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "Polls API v1"); } ); app.UseHttpsRedirection(); app.UseRouting(); app.UseCors("MyPolicy"); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseAuthentication(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); DBInitializer.Initialize(context); }
public PollsRepository(PollsContext ctx) { _context = ctx; }
public AnswersRepository(PollsContext context) { _context = context; }
public PollVoteController(PollsContext context) { _context = context; }
public UserService(IOptions <AppSettings> appSettings, PollsContext context) { _appSettings = appSettings.Value; _context = context; }
public QuestionsRepository(PollsContext context) { _context = context; }
public FriendController(PollsContext context, IMessageService messageService, IUserService userService) { _context = context; _messageService = messageService; _userService = userService; }
public IssuesController(PollsContext context) { _context = context; }
// 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, PollsContext context) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseBrowserLink(); } else { app.UseExceptionHandler("/Home/Error"); } app.UseStaticFiles(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); DbInitializer.Initialize(context); }
public PollsRepository(PollsContext context) { _context = context; }
public PollUserController(PollsContext context) { _context = context; }