Exemple #1
0
        public DeleteBrandHandlerTests()
        {
            _fixture         = new Fixture();
            _databaseContext = Substitute.For <IMotoDatabaseContext>();

            _sut = new DeleteBrandHandler(_databaseContext);
        }
Exemple #2
0
 public BrandsQuery(IMotoDatabaseContext motoDatabaseContext, ICurrentUserService currentUserService)
     : base(ApplicationType.Moto, currentUserService)
 {
     _motoDatabaseContext = motoDatabaseContext;
 }
Exemple #3
0
 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));
 }
Exemple #6
0
 public UpdateBrandHandler(IMotoDatabaseContext motoDatabaseContext)
 {
     _motoDatabaseContext = motoDatabaseContext;
 }
Exemple #7
0
        // 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");
            });
        }