public DeleteBrandHandlerTests() { _fixture = new Fixture(); _databaseContext = Substitute.For <IMotoDatabaseContext>(); _sut = new DeleteBrandHandler(_databaseContext); }
public BrandsQuery(IMotoDatabaseContext motoDatabaseContext, ICurrentUserService currentUserService) : base(ApplicationType.Moto, currentUserService) { _motoDatabaseContext = motoDatabaseContext; }
public DeleteBrandHandler(IMotoDatabaseContext databaseContext) { _databaseContext = databaseContext; }
public DeleteBrandRequestValidator(IMotoDatabaseContext databaseContext) { }
public UpdateBrandRequestValidator(IMotoDatabaseContext motoDatabaseContext) { RuleFor(b => b.BrandId).MustAsync((brandId, c) => motoDatabaseContext.Brands.AnyAsync(b => b.BrandId == brandId, c)); }
public UpdateBrandHandler(IMotoDatabaseContext motoDatabaseContext) { _motoDatabaseContext = motoDatabaseContext; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IDatabaseContext databaseContext, IMotoDatabaseContext motoDatabaseContext) { app.UseProblemDetails(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } databaseContext.Migrate(); motoDatabaseContext.Migrate(); ConfigureSwagger(app); ConfigureGraphQL(app); app.UseHttpsRedirection(); app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); app.UseEndpoints(endpoints => { //endpoints.MapGrpcService<AuthorizeService>(); endpoints.MapControllers(); endpoints.MapHealthChecks("/health"); }); }