Exemple #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, ApollyContext context)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                // 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.UseCors("MyPolicy");
            app.UseSwagger();
            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "MyAPI V1");
            });
            app.UseHttpsRedirection();
            app.UseAuthentication();
            app.UseMvc();

            DBInitializer.Initialize(context);
        }
 public AnswerController(ApollyContext context)
 {
     _context = context;
 }
Exemple #3
0
 public PollMembersController(ApollyContext context)
 {
     _context = context;
 }
 public UserService(IOptions <AppSettings> appSettings, ApollyContext memberContext)
 {
     _appSettings = appSettings.Value; _memberContext = memberContext;
 }
Exemple #5
0
 public FriendsController(ApollyContext context)
 {
     _context = context;
 }
Exemple #6
0
 public VoteController(ApollyContext context)
 {
     _context = context;
 }
Exemple #7
0
 public PollController(ApollyContext context)
 {
     _context = context;
 }
Exemple #8
0
 public MemberController(ApollyContext context, IUserService userService)
 {
     _userService = userService;
     _context     = context;
 }