diff --git a/src/Services/Booking/src/Booking/Extensions/CoreExtensions.cs b/src/Services/Booking/src/Booking/Extensions/CoreExtensions.cs index a00853f..d2cd99f 100644 --- a/src/Services/Booking/src/Booking/Extensions/CoreExtensions.cs +++ b/src/Services/Booking/src/Booking/Extensions/CoreExtensions.cs @@ -1,23 +1,23 @@ using BuildingBlocks.Core; using BuildingBlocks.Utils; -using BuildingBlocks.Web; -using Microsoft.Extensions.Configuration; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.DependencyInjection; namespace Booking.Extensions; public static class CoreExtensions { - public static IServiceCollection AddCore(this IServiceCollection services, IConfiguration configuration) + public static IServiceCollection AddCore(this IServiceCollection services) { - services.AddOptions() - .Bind(configuration.GetSection(nameof(AppOptions))) - .ValidateDataAnnotations(); - services.AddScoped(); - services.AddTransient(); + services.AddScoped(); services.AddScoped(); + services.Configure(options => + { + options.SuppressModelStateInvalidFilter = true; + }); + return services; } } diff --git a/src/Services/Flight/src/Flight/Extensions/CoreExtensions.cs b/src/Services/Flight/src/Flight/Extensions/CoreExtensions.cs index 44c7c73..a6a5762 100644 --- a/src/Services/Flight/src/Flight/Extensions/CoreExtensions.cs +++ b/src/Services/Flight/src/Flight/Extensions/CoreExtensions.cs @@ -1,23 +1,23 @@ using BuildingBlocks.Core; using BuildingBlocks.Utils; -using BuildingBlocks.Web; -using Microsoft.Extensions.Configuration; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.DependencyInjection; namespace Flight.Extensions; public static class CoreExtensions { - public static IServiceCollection AddCore(this IServiceCollection services, IConfiguration configuration) + public static IServiceCollection AddCore(this IServiceCollection services) { - services.AddOptions() - .Bind(configuration.GetSection(nameof(AppOptions))) - .ValidateDataAnnotations(); - services.AddScoped(); - services.AddTransient(); + services.AddScoped(); services.AddScoped(); + services.Configure(options => + { + options.SuppressModelStateInvalidFilter = true; + }); + return services; } } diff --git a/src/Services/Identity/src/Identity/Extensions/CoreExtensions.cs b/src/Services/Identity/src/Identity/Extensions/CoreExtensions.cs index e9af8d5..f914c33 100644 --- a/src/Services/Identity/src/Identity/Extensions/CoreExtensions.cs +++ b/src/Services/Identity/src/Identity/Extensions/CoreExtensions.cs @@ -1,21 +1,21 @@ using BuildingBlocks.Core; -using BuildingBlocks.Web; -using Microsoft.Extensions.Configuration; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.DependencyInjection; namespace Identity.Extensions; public static class CoreExtensions { - public static IServiceCollection AddCore(this IServiceCollection services, IConfiguration configuration) + public static IServiceCollection AddCore(this IServiceCollection services) { - services.AddOptions() - .Bind(configuration.GetSection(nameof(AppOptions))) - .ValidateDataAnnotations(); - - services.AddTransient(); + services.AddScoped(); services.AddScoped(); + services.Configure(options => + { + options.SuppressModelStateInvalidFilter = true; + }); + return services; } } diff --git a/src/Services/Passenger/src/Passenger/Extensions/CoreExtensions.cs b/src/Services/Passenger/src/Passenger/Extensions/CoreExtensions.cs index 349c32d..3cc6e0e 100644 --- a/src/Services/Passenger/src/Passenger/Extensions/CoreExtensions.cs +++ b/src/Services/Passenger/src/Passenger/Extensions/CoreExtensions.cs @@ -1,25 +1,23 @@ using BuildingBlocks.Core; using BuildingBlocks.Utils; -using BuildingBlocks.Web; -using Microsoft.Extensions.Configuration; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.DependencyInjection; namespace Passenger.Extensions; public static class CoreExtensions { - public static IServiceCollection AddCore(this IServiceCollection services, IConfiguration configuration) + public static IServiceCollection AddCore(this IServiceCollection services) { - configuration.GetSection(nameof(AppOptions)).Bind(nameof(AppOptions)); - - services.AddOptions() - .Bind(configuration.GetSection(nameof(AppOptions))) - .ValidateDataAnnotations(); - services.AddScoped(); - services.AddTransient(); + services.AddScoped(); services.AddScoped(); + services.Configure(options => + { + options.SuppressModelStateInvalidFilter = true; + }); + return services; } }