diff --git a/Microservice.Customer.Api.Test.Unit/GetCustomerMediatrTests.cs b/Microservice.Customer.Api.Test.Unit/GetCustomerMediatrTests.cs index 2e21c64..4ab6937 100644 --- a/Microservice.Customer.Api.Test.Unit/GetCustomerMediatrTests.cs +++ b/Microservice.Customer.Api.Test.Unit/GetCustomerMediatrTests.cs @@ -17,7 +17,6 @@ public class GetCustomerMediatrTests { private readonly Mock customerRepositoryMock = new(); private readonly Mock customerHttpAccessorMock = new(); - private readonly Mock> loggerMock = new(); private readonly ServiceCollection services = new(); private ServiceProvider serviceProvider; private IMediator mediator; @@ -67,9 +66,12 @@ public async Task Get_customer_return_customer() var actualResult = await mediator.Send(getCustomerRequest); var expectedResult = new GetCustomerResponse(email, surname, firstName); - Assert.That(actualResult.Email, Is.EqualTo(expectedResult.Email)); - Assert.That(actualResult.Surname, Is.EqualTo(expectedResult.Surname)); - Assert.That(actualResult.FirstName, Is.EqualTo(expectedResult.FirstName)); + Assert.Multiple(() => + { + Assert.That(actualResult.Email, Is.EqualTo(expectedResult.Email)); + Assert.That(actualResult.Surname, Is.EqualTo(expectedResult.Surname)); + Assert.That(actualResult.FirstName, Is.EqualTo(expectedResult.FirstName)); + }); } [Test] diff --git a/Microservice.Customer.Api.Test.Unit/UpdateCustomerMediatrTests.cs b/Microservice.Customer.Api.Test.Unit/UpdateCustomerMediatrTests.cs index d9d510f..0c97946 100644 --- a/Microservice.Customer.Api.Test.Unit/UpdateCustomerMediatrTests.cs +++ b/Microservice.Customer.Api.Test.Unit/UpdateCustomerMediatrTests.cs @@ -5,7 +5,7 @@ using Microservice.Customer.Api.Data.Repository.Interfaces; using Microservice.Customer.Api.Helpers; using Microservice.Customer.Api.Helpers.Interfaces; -using Microservice.Customer.Api.MediatR.AddCustomer; +using Microservice.Customer.Api.Mediatr.UpdateCustomer; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Moq; @@ -18,7 +18,6 @@ public class UpdateCustomerMediatrTests { private readonly Mock customerRepositoryMock = new(); private readonly Mock customerHttpAccessorMock = new(); - private readonly Mock> loggerMock = new(); private readonly ServiceCollection services = new(); private ServiceProvider serviceProvider; private IMediator mediator; @@ -160,13 +159,16 @@ public void Customer_not_updated_invalid_surname_first_name_return_exception_fai await mediator.Send(updateCustomerRequest); }); - Assert.That(validationException.Errors.Count, Is.EqualTo(2)); - Assert.That(validationException.Errors.ElementAt(0).ErrorMessage, Is.EqualTo("Surname length between 1 and 30.")); - Assert.That(validationException.Errors.ElementAt(1).ErrorMessage, Is.EqualTo("First name length between 1 and 30.")); + Assert.Multiple(() => + { + Assert.That(validationException.Errors.Count, Is.EqualTo(2)); + Assert.That(validationException.Errors.ElementAt(0).ErrorMessage, Is.EqualTo("Surname length between 1 and 30.")); + Assert.That(validationException.Errors.ElementAt(1).ErrorMessage, Is.EqualTo("First name length between 1 and 30.")); + }); } [Test] - public void Customer_not_updated_no_email_surname_firstname_return_exception_fail_message() + public void Customer_not_updated_no_email_surname_first_name_return_exception_fail_message() { customerRepositoryMock .Setup(x => x.ExistsAsync("ValidEmail@hotmail.com")) @@ -179,13 +181,16 @@ public void Customer_not_updated_no_email_surname_firstname_return_exception_fai await mediator.Send(updateCustomerRequest); }); - Assert.That(validationException.Errors.Count, Is.EqualTo(7)); - Assert.That(validationException.Errors.ElementAt(0).ErrorMessage, Is.EqualTo("Email is required.")); - Assert.That(validationException.Errors.ElementAt(1).ErrorMessage, Is.EqualTo("Email length between 8 and 150.")); - Assert.That(validationException.Errors.ElementAt(2).ErrorMessage, Is.EqualTo("Invalid Email.")); - Assert.That(validationException.Errors.ElementAt(3).ErrorMessage, Is.EqualTo("Surname is required.")); - Assert.That(validationException.Errors.ElementAt(4).ErrorMessage, Is.EqualTo("Surname length between 1 and 30.")); - Assert.That(validationException.Errors.ElementAt(5).ErrorMessage, Is.EqualTo("First name is required.")); - Assert.That(validationException.Errors.ElementAt(6).ErrorMessage, Is.EqualTo("First name length between 1 and 30.")); + Assert.Multiple(() => + { + Assert.That(validationException.Errors.Count, Is.EqualTo(7)); + Assert.That(validationException.Errors.ElementAt(0).ErrorMessage, Is.EqualTo("Email is required.")); + Assert.That(validationException.Errors.ElementAt(1).ErrorMessage, Is.EqualTo("Email length between 8 and 150.")); + Assert.That(validationException.Errors.ElementAt(2).ErrorMessage, Is.EqualTo("Invalid Email.")); + Assert.That(validationException.Errors.ElementAt(3).ErrorMessage, Is.EqualTo("Surname is required.")); + Assert.That(validationException.Errors.ElementAt(4).ErrorMessage, Is.EqualTo("Surname length between 1 and 30.")); + Assert.That(validationException.Errors.ElementAt(5).ErrorMessage, Is.EqualTo("First name is required.")); + Assert.That(validationException.Errors.ElementAt(6).ErrorMessage, Is.EqualTo("First name length between 1 and 30.")); + }); } } \ No newline at end of file diff --git a/Microservice.Customer.Api/Data/Context/CustomerDbContext.cs b/Microservice.Customer.Api/Data/Context/CustomerDbContext.cs index bd18b70..e412c36 100644 --- a/Microservice.Customer.Api/Data/Context/CustomerDbContext.cs +++ b/Microservice.Customer.Api/Data/Context/CustomerDbContext.cs @@ -1,12 +1,9 @@ -using Microservice.Customer.Api.Data.Context; -using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; -namespace Microservice.Customer.Api.Data.Contexts; +namespace Microservice.Customer.Api.Data.Context; -public class CustomerDbContext : DbContext +public class CustomerDbContext(DbContextOptions options) : DbContext(options) { - public CustomerDbContext(DbContextOptions options) : base(options) { } - public DbSet Customer { get; set; } protected override void OnModelCreating(ModelBuilder modelBuilder) diff --git a/Microservice.Customer.Api/Data/Context/DefaultData.cs b/Microservice.Customer.Api/Data/Context/DefaultData.cs index c527096..a780211 100644 --- a/Microservice.Customer.Api/Data/Context/DefaultData.cs +++ b/Microservice.Customer.Api/Data/Context/DefaultData.cs @@ -4,11 +4,11 @@ public class DefaultData { public static List GetCustomerDefaultData() { - return new List() - { + return + [ CreateCustomer(new Guid("6c84d0a3-0c0c-435f-9ae0-4de09247ee15"), "Intergration_Test", "Intergration_Test", "intergration-test-user@example.com"), CreateCustomer(new Guid("929eaf82-e4fd-4efe-9cae-ce4d7e32d159"), "Intergration_Test2", "Intergration_Test2", "intergration-test-user2@example.com") - }; + ]; } private static Domain.Customer CreateCustomer(Guid id, string surname, string firstName, string email) diff --git a/Microservice.Customer.Api/Data/Repository/CustomerRepository.cs b/Microservice.Customer.Api/Data/Repository/CustomerRepository.cs index dca21d1..c5298a3 100644 --- a/Microservice.Customer.Api/Data/Repository/CustomerRepository.cs +++ b/Microservice.Customer.Api/Data/Repository/CustomerRepository.cs @@ -1,4 +1,4 @@ -using Microservice.Customer.Api.Data.Contexts; +using Microservice.Customer.Api.Data.Context; using Microservice.Customer.Api.Data.Repository.Interfaces; using Microsoft.EntityFrameworkCore; diff --git a/Microservice.Customer.Api/Endpoints/Endpoints.cs b/Microservice.Customer.Api/Endpoints/Endpoints.cs index 55e7bdb..e4edd8b 100644 --- a/Microservice.Customer.Api/Endpoints/Endpoints.cs +++ b/Microservice.Customer.Api/Endpoints/Endpoints.cs @@ -4,7 +4,7 @@ using Microservice.Customer.Api.Extensions; using Microservice.Customer.Api.Helpers.Exceptions; using Microservice.Customer.Api.Helpers.Interfaces; -using Microservice.Customer.Api.MediatR.AddCustomer; +using Microservice.Customer.Api.Mediatr.UpdateCustomer; using Microservice.Customer.Api.MediatR.GetCustomer; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Authorization; @@ -16,9 +16,9 @@ namespace Microservice.Customer.Api.Endpoints; public static class Endpoints { - public static void ConfigureRoutes(this WebApplication app, ConfigurationManager configuration) + public static void ConfigureRoutes(this WebApplication webApplication) { - var customerGroup = app.MapGroup("v{version:apiVersion}/customers").WithTags("customers"); + var customerGroup = webApplication.MapGroup("v{version:apiVersion}/customers").WithTags("customers"); customerGroup.MapGet("/logged-in", [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] async ([FromServices] IMediator mediator, ICustomerHttpAccessor customerHttpAccessor) => @@ -30,13 +30,13 @@ public static void ConfigureRoutes(this WebApplication app, ConfigurationManager .Produces((int)HttpStatusCode.BadRequest) .Produces((int)HttpStatusCode.BadRequest) .WithName("GetCustomer") - .WithApiVersionSet(app.GetApiVersionSet()) + .WithApiVersionSet(webApplication.GetApiVersionSet()) .MapToApiVersion(new ApiVersion(1, 0)) .WithOpenApi(x => new OpenApiOperation(x) { Summary = "Get a customer based on id.", Description = "Gets a customer based on its id.", - Tags = new List { new() { Name = "Microservice Customer System - Customers" } } + Tags = [new() { Name = "Microservice Customer System - Customers" }] }); customerGroup.MapPut("/update", [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] @@ -54,14 +54,14 @@ public static void ConfigureRoutes(this WebApplication app, ConfigurationManager .Produces((int)HttpStatusCode.BadRequest) .Produces((int)HttpStatusCode.BadRequest) .WithName("UpdateCustomer") - .WithApiVersionSet(app.GetApiVersionSet()) + .WithApiVersionSet(webApplication.GetApiVersionSet()) .MapToApiVersion(new ApiVersion(1, 0)) .RequireAuthorization() .WithOpenApi(x => new OpenApiOperation(x) { Summary = "Update customer details.", Description = "Updates a customers details.", - Tags = new List { new() { Name = "Microservice Customer System - Customers" } } + Tags = [new() { Name = "Microservice Customer System - Customers" }] }); } } \ No newline at end of file diff --git a/Microservice.Customer.Api/Extensions/AppExtensions.cs b/Microservice.Customer.Api/Extensions/AppExtensions.cs index 37621f7..01077ce 100644 --- a/Microservice.Customer.Api/Extensions/AppExtensions.cs +++ b/Microservice.Customer.Api/Extensions/AppExtensions.cs @@ -6,16 +6,16 @@ namespace Microservice.Customer.Api.Extensions; public static class AppExtensions { - public static void ConfigureSwagger(this WebApplication app) + public static void ConfigureSwagger(this WebApplication webApplication) { - if (app.Environment.IsDevelopment()) + if (webApplication.Environment.IsDevelopment()) { - app.UseSwagger(); - app.UseSwaggerUI(options => + webApplication.UseSwagger(); + webApplication.UseSwaggerUI(options => { options.ConfigObject.AdditionalItems.Add("syntaxHighlight", false); - var descriptions = app.DescribeApiVersions(); + var descriptions = webApplication.DescribeApiVersions(); // Build a swagger endpoint for each discovered API version foreach (var description in descriptions) @@ -28,19 +28,19 @@ public static void ConfigureSwagger(this WebApplication app) } } - public static ApiVersionSet GetApiVersionSet(this WebApplication app) + public static ApiVersionSet GetApiVersionSet(this WebApplication webApplication) { - return app.NewApiVersionSet() + return webApplication.NewApiVersionSet() .HasApiVersion(new ApiVersion(1)) .ReportApiVersions() .Build(); } - public static void ConfigureMiddleware(this WebApplication app) + public static void ConfigureMiddleware(this WebApplication webApplication) { - if (!app.Environment.IsDevelopment()) + if (!webApplication.Environment.IsDevelopment()) { - app.UseMiddleware(); + webApplication.UseMiddleware(); } } } \ No newline at end of file diff --git a/Microservice.Customer.Api/Extensions/IServiceCollectionExtensions.cs b/Microservice.Customer.Api/Extensions/IServiceCollectionExtensions.cs index 8342a02..b2d9d94 100644 --- a/Microservice.Customer.Api/Extensions/IServiceCollectionExtensions.cs +++ b/Microservice.Customer.Api/Extensions/IServiceCollectionExtensions.cs @@ -1,8 +1,7 @@ using Asp.Versioning; using FluentValidation; using MediatR; -using Microservice.Customer.Api.Address.Api.Extensions; -using Microservice.Customer.Api.Data.Contexts; +using Microservice.Customer.Api.Data.Context; using Microservice.Customer.Api.Data.Repository; using Microservice.Customer.Api.Data.Repository.Interfaces; using Microservice.Customer.Api.Helpers; diff --git a/Microservice.Customer.Api/Extensions/JwtExtensions.cs b/Microservice.Customer.Api/Extensions/JwtExtensions.cs index 1662a05..b2f55fd 100644 --- a/Microservice.Customer.Api/Extensions/JwtExtensions.cs +++ b/Microservice.Customer.Api/Extensions/JwtExtensions.cs @@ -3,7 +3,7 @@ using Microsoft.IdentityModel.Tokens; using System.Text; -namespace Microservice.Customer.Api.Address.Api.Extensions; +namespace Microservice.Customer.Api.Extensions; public static class JwtExtensions { diff --git a/Microservice.Customer.Api/Helpers/CustomerHttpAccessor.cs b/Microservice.Customer.Api/Helpers/CustomerHttpAccessor.cs index 97afb94..97bab3f 100644 --- a/Microservice.Customer.Api/Helpers/CustomerHttpAccessor.cs +++ b/Microservice.Customer.Api/Helpers/CustomerHttpAccessor.cs @@ -2,13 +2,9 @@ namespace Microservice.Customer.Api.Helpers; -public class CustomerHttpAccessor : Interfaces.ICustomerHttpAccessor +public class CustomerHttpAccessor(IHttpContextAccessor accessor) : Interfaces.ICustomerHttpAccessor { - private readonly IHttpContextAccessor _accessor; - public CustomerHttpAccessor(IHttpContextAccessor accessor) - { - _accessor = accessor; - } + private readonly IHttpContextAccessor _accessor = accessor; public Guid CustomerId => new(_accessor.HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier)); } diff --git a/Microservice.Customer.Api/Helpers/Swagger/ConfigureSwaggerOptions.cs b/Microservice.Customer.Api/Helpers/Swagger/ConfigureSwaggerOptions.cs index da2154e..591f8a0 100644 --- a/Microservice.Customer.Api/Helpers/Swagger/ConfigureSwaggerOptions.cs +++ b/Microservice.Customer.Api/Helpers/Swagger/ConfigureSwaggerOptions.cs @@ -5,11 +5,9 @@ namespace Microservice.Customer.Api.Helpers.Swagger; -public class ConfigureSwaggerOptions : IConfigureOptions +public class ConfigureSwaggerOptions(IApiVersionDescriptionProvider provider) : IConfigureOptions { - private readonly IApiVersionDescriptionProvider _provider; - - public ConfigureSwaggerOptions(IApiVersionDescriptionProvider provider) => _provider = provider; + private readonly IApiVersionDescriptionProvider _provider = provider; public void Configure(SwaggerGenOptions options) { diff --git a/Microservice.Customer.Api/Helpers/ValidatorBehavior.cs b/Microservice.Customer.Api/Helpers/ValidatorBehavior.cs index 41b70c7..d0089a3 100644 --- a/Microservice.Customer.Api/Helpers/ValidatorBehavior.cs +++ b/Microservice.Customer.Api/Helpers/ValidatorBehavior.cs @@ -3,14 +3,9 @@ namespace Microservice.Customer.Api.Helpers; -public class ValidatorBehavior : IPipelineBehavior where TRequest : IRequest +public class ValidatorBehavior(IEnumerable> validators) : IPipelineBehavior where TRequest : IRequest { - private readonly IEnumerable> _validators; - - public ValidatorBehavior(IEnumerable> validators) - { - _validators = validators; - } + private readonly IEnumerable> _validators = validators; public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) { diff --git a/Microservice.Customer.Api/Mediatr/GetCustomer/GetCustomerValidator.cs b/Microservice.Customer.Api/Mediatr/GetCustomer/GetCustomerValidator.cs index 7b48de7..694d852 100644 --- a/Microservice.Customer.Api/Mediatr/GetCustomer/GetCustomerValidator.cs +++ b/Microservice.Customer.Api/Mediatr/GetCustomer/GetCustomerValidator.cs @@ -3,12 +3,7 @@ namespace Microservice.Customer.Api.MediatR.GetCustomer; -public class GetCustomerValidator : AbstractValidator +public class GetCustomerValidator(ICustomerRepository customerRepository) : AbstractValidator { - private readonly ICustomerRepository _customerRepository; - - public GetCustomerValidator(ICustomerRepository customerRepository) - { - _customerRepository = customerRepository; - } + private readonly ICustomerRepository _customerRepository = customerRepository; } \ No newline at end of file diff --git a/Microservice.Customer.Api/Mediatr/UpdateCustomer/UpdateCustomerCommandHandler.cs b/Microservice.Customer.Api/Mediatr/UpdateCustomer/UpdateCustomerCommandHandler.cs index 2d1d6d9..0abf05f 100644 --- a/Microservice.Customer.Api/Mediatr/UpdateCustomer/UpdateCustomerCommandHandler.cs +++ b/Microservice.Customer.Api/Mediatr/UpdateCustomer/UpdateCustomerCommandHandler.cs @@ -4,7 +4,7 @@ using Microservice.Customer.Api.Helpers.Exceptions; using Microservice.Customer.Api.Helpers.Interfaces; -namespace Microservice.Customer.Api.MediatR.AddCustomer; +namespace Microservice.Customer.Api.Mediatr.UpdateCustomer; public class UpdateCustomerCommandHandler(ICustomerRepository customerRepository, ILogger logger, diff --git a/Microservice.Customer.Api/Mediatr/UpdateCustomer/UpdateCustomerMapper.cs b/Microservice.Customer.Api/Mediatr/UpdateCustomer/UpdateCustomerMapper.cs index 7242a33..895f696 100644 --- a/Microservice.Customer.Api/Mediatr/UpdateCustomer/UpdateCustomerMapper.cs +++ b/Microservice.Customer.Api/Mediatr/UpdateCustomer/UpdateCustomerMapper.cs @@ -1,12 +1,12 @@ using AutoMapper; -namespace Microservice.Customer.Api.MediatR.AddCustomer; +namespace Microservice.Customer.Api.Mediatr.UpdateCustomer; public class UpdateCustomerMapper : Profile { public UpdateCustomerMapper() { - base.CreateMap() + CreateMap() .ForMember(dest => dest.Id, opt => opt.Ignore()) .ForMember(x => x.Email, act => act.MapFrom(src => src.Email)) .ForMember(x => x.Surname, act => act.MapFrom(src => src.Surname)) diff --git a/Microservice.Customer.Api/Mediatr/UpdateCustomer/UpdateCustomerRequest.cs b/Microservice.Customer.Api/Mediatr/UpdateCustomer/UpdateCustomerRequest.cs index acc0358..6f099af 100644 --- a/Microservice.Customer.Api/Mediatr/UpdateCustomer/UpdateCustomerRequest.cs +++ b/Microservice.Customer.Api/Mediatr/UpdateCustomer/UpdateCustomerRequest.cs @@ -1,5 +1,5 @@ using MediatR; -namespace Microservice.Customer.Api.MediatR.AddCustomer; +namespace Microservice.Customer.Api.Mediatr.UpdateCustomer; public record UpdateCustomerRequest(Guid Id, string Email, string Surname, string FirstName) : IRequest; \ No newline at end of file diff --git a/Microservice.Customer.Api/Mediatr/UpdateCustomer/UpdateCustomerResponse.cs b/Microservice.Customer.Api/Mediatr/UpdateCustomer/UpdateCustomerResponse.cs index f2102d6..86c8785 100644 --- a/Microservice.Customer.Api/Mediatr/UpdateCustomer/UpdateCustomerResponse.cs +++ b/Microservice.Customer.Api/Mediatr/UpdateCustomer/UpdateCustomerResponse.cs @@ -1,3 +1,3 @@ -namespace Microservice.Customer.Api.MediatR.AddCustomer; +namespace Microservice.Customer.Api.Mediatr.UpdateCustomer; public record UpdateCustomerResponse(string message); \ No newline at end of file diff --git a/Microservice.Customer.Api/Mediatr/UpdateCustomer/UpdateCustomerValidator.cs b/Microservice.Customer.Api/Mediatr/UpdateCustomer/UpdateCustomerValidator.cs index 7fff4d5..62c62bc 100644 --- a/Microservice.Customer.Api/Mediatr/UpdateCustomer/UpdateCustomerValidator.cs +++ b/Microservice.Customer.Api/Mediatr/UpdateCustomer/UpdateCustomerValidator.cs @@ -1,7 +1,7 @@ using FluentValidation; using Microservice.Customer.Api.Data.Repository.Interfaces; -namespace Microservice.Customer.Api.MediatR.AddCustomer; +namespace Microservice.Customer.Api.Mediatr.UpdateCustomer; public class UpdateCustomerValidator : AbstractValidator { diff --git a/Microservice.Customer.Api/Middleware/ExceptionHandlingMiddleware.cs b/Microservice.Customer.Api/Middleware/ExceptionHandlingMiddleware.cs index 61e3d91..9db6827 100644 --- a/Microservice.Customer.Api/Middleware/ExceptionHandlingMiddleware.cs +++ b/Microservice.Customer.Api/Middleware/ExceptionHandlingMiddleware.cs @@ -7,11 +7,9 @@ namespace Microservice.Customer.Api.Middleware; -internal sealed class ExceptionHandlingMiddleware : IMiddleware +internal sealed class ExceptionHandlingMiddleware(ILogger logger) : IMiddleware { - private readonly ILogger _logger; - - public ExceptionHandlingMiddleware(ILogger logger) => _logger = logger; + private readonly ILogger _logger = logger; public async Task InvokeAsync(HttpContext context, RequestDelegate next) { @@ -26,7 +24,7 @@ public async Task InvokeAsync(HttpContext context, RequestDelegate next) } } - private Task HandleExceptionAsync(HttpContext context, Exception exception) + private static Task HandleExceptionAsync(HttpContext context, Exception exception) { var httpStatusCode = HttpStatusCode.InternalServerError; diff --git a/Microservice.Customer.Api/Migrations/20240727104340_create-table-default-data.Designer.cs b/Microservice.Customer.Api/Migrations/20240727104340_create-table-default-data.Designer.cs index 10c0970..5c415a5 100644 --- a/Microservice.Customer.Api/Migrations/20240727104340_create-table-default-data.Designer.cs +++ b/Microservice.Customer.Api/Migrations/20240727104340_create-table-default-data.Designer.cs @@ -1,6 +1,6 @@ // using System; -using Microservice.Customer.Api.Data.Contexts; +using Microservice.Customer.Api.Data.Context; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; diff --git a/Microservice.Customer.Api/Migrations/CustomerDbContextModelSnapshot.cs b/Microservice.Customer.Api/Migrations/CustomerDbContextModelSnapshot.cs index b365b9b..cf0809e 100644 --- a/Microservice.Customer.Api/Migrations/CustomerDbContextModelSnapshot.cs +++ b/Microservice.Customer.Api/Migrations/CustomerDbContextModelSnapshot.cs @@ -1,6 +1,6 @@ // using System; -using Microservice.Customer.Api.Data.Contexts; +using Microservice.Customer.Api.Data.Context; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; diff --git a/Microservice.Customer.Api/Program.cs b/Microservice.Customer.Api/Program.cs index 3c57375..b690156 100644 --- a/Microservice.Customer.Api/Program.cs +++ b/Microservice.Customer.Api/Program.cs @@ -23,6 +23,6 @@ app.UseAuthorization(); app.ConfigureMiddleware(); -Endpoints.ConfigureRoutes(app, builder.Configuration); +Endpoints.ConfigureRoutes(app); -app.Run(); +app.Run(); \ No newline at end of file