Пример #1
0
        // 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);
        }
Пример #2
0
 public PollsRepository(PollsContext ctx)
 {
     _context = ctx;
 }
Пример #3
0
 public AnswersRepository(PollsContext context)
 {
     _context = context;
 }
Пример #4
0
 public PollVoteController(PollsContext context)
 {
     _context = context;
 }
Пример #5
0
 public UserService(IOptions <AppSettings> appSettings, PollsContext context)
 {
     _appSettings = appSettings.Value;
     _context     = context;
 }
Пример #6
0
 public QuestionsRepository(PollsContext context)
 {
     _context = context;
 }
Пример #7
0
 public FriendController(PollsContext context, IMessageService messageService, IUserService userService)
 {
     _context        = context;
     _messageService = messageService;
     _userService    = userService;
 }
Пример #8
0
 public IssuesController(PollsContext context)
 {
     _context = context;
 }
Пример #9
0
        // 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);
        }
Пример #10
0
 public PollsRepository(PollsContext context)
 {
     _context = context;
 }
Пример #11
0
 public PollUserController(PollsContext context)
 {
     _context = context;
 }