// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, CartServicesContext context) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); ModelBuilderExtensions.env = env; //property dependancy als test } //2.3 Swagger app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "CartServices v1"); }); app.UseRouting(); //vóór de endpoints. app.UseAuthentication(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }
public CartRepo(CartServicesContext _context) : base(_context) { }
private readonly Guid TESTUSERID = ModelBuilderExtensions.TESTUSERID; //enkel in development public CartsController(CartServicesContext context, ICartRepo cartItemRepo, ICartSender cartSender) { this.cartRepo = cartItemRepo; this.cartSender = cartSender; }
//ctor dependancy van de applicatie context: public GenericRepo(CartServicesContext context) { this._context = context; }