Esempio n. 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, QuotesDbContext _context)
        {
            MigrateDb(app);
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseHttpsRedirection();
            // Enable middleware to serve generated Swagger as a JSON endpoint.
            //_context.Database.Migrate();
            app.UseResponseCaching();
            app.UseSwagger();

            // Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.),
            // specifying the Swagger JSON endpoint.
            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1");
            });

            app.UseRouting();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
        }
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, QuotesDbContext quotesDbContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
                app.UseHsts();
            }

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

            app.UseRouting();

            app.UseAuthorization();

            // quotesDbContext.Database.EnsureCreated();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });

            app.UseResponseCaching();

            app.UseAuthentication();
        }
Esempio n. 3
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, QuotesDbContext quotesDbContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            quotesDbContext.Database.EnsureCreated();
            app.UseMvc();
        }
Esempio n. 4
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, QuotesDbContext quotesDbContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            // quotesDbContext.Database.Migrate();
            app.UseResponseCaching();
            // 2. Enable authentication middleware
            app.UseAuthentication();
            app.UseMvc();
        }
Esempio n. 5
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, QuotesDbContext quotesDbContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseHttpsRedirection();

            quotesDbContext.Database.EnsureCreated();

            app.UseRouting();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
        }
Esempio n. 6
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, QuotesDbContext dbContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHsts();
            }

            //dbContext.Database.EnsureCreated(); // comment out if using migrations

            app.UseResponseCaching();
            // Enable authentication middleware
            app.UseAuthentication();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });

            // Enable authentication middleware
            app.UseAuthentication();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });

            app.UseHttpsRedirection();
            app.UseMvc();
        }
 public HomeController(ILogger <HomeController> logger, QuotesDbContext con)
 {
     _logger = logger;
     Context = con;
 }
Esempio n. 8
0
 public HomeController(ILogger <HomeController> logger, QuotesDbContext ctx)
 {
     _logger = logger;
     context = ctx;
 }
 public QuotesController(QuotesDbContext dbContext)
 {
     quotesDbContext = dbContext;
 }
Esempio n. 10
0
 public CreateQuoteModel(QuotesDbContext db)
 {
     _db = db;
 }
Esempio n. 11
0
 public EditModel(QuotesDbContext db)
 {
     _db = db;
 }
Esempio n. 12
0
 public QuotesController(QuotesDbContext context)
 {
     this.context = context;
 }
Esempio n. 13
0
 public DbQuotesRepository(QuotesDbContext db)
 {
     _db = db;
 }
Esempio n. 14
0
 public PersonController(QuotesDbContext quotesDbContext)
 {
     _QuotesDbContext = quotesDbContext;
 }
 public QuoteRepository(QuotesDbContext context, EmailSender emailSender)
 {
     _context     = context;
     _emailSender = emailSender;
 }
Esempio n. 16
0
 public QuotesListModel(QuotesDbContext db)
 {
     _db = db;
 }
 public IndexModel(QuotesDbContext db)
 {
     _db = db;
 }
Esempio n. 18
0
 public ElementRepository(QuotesDbContext quotesDbContext)
 {
     _quotesDbContext = quotesDbContext;
 }
Esempio n. 19
0
 public HomeController(ILogger <HomeController> logger, IQuotesRepository repository, QuotesDbContext context)
 {
     _logger     = logger;
     _context    = context;
     _repository = repository;
 }
 public QuoteRepository(QuotesDbContext dbContext)
 {
     _dbContext = dbContext;
 }
Esempio n. 21
0
 /*Not sure where yet but the dbcontext object with the options is being injected here.
  * this constructor uses the QuotesDbContext referenced in the (Startup.cs)ConfigureServices to
  * resolve this dependency(Also most likely uses IOC)*/
 public QuotesController(QuotesDbContext quotesDbContext)
 {
     _quotesDbContext = quotesDbContext;
 }
Esempio n. 22
0
 public TagsController(QuotesDbContext context)
 {
     _context = context;
 }