mirror of
https://github.com/meysamhadeli/booking-microservices.git
synced 2026-04-11 19:02:15 +08:00
commit
0dfd45f33e
@ -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<AppOptions>()
|
||||
.Bind(configuration.GetSection(nameof(AppOptions)))
|
||||
.ValidateDataAnnotations();
|
||||
|
||||
services.AddScoped<ICurrentUserProvider, CurrentUserProvider>();
|
||||
services.AddTransient<IEventMapper, EventMapper>();
|
||||
services.AddScoped<IEventMapper, EventMapper>();
|
||||
services.AddScoped<IEventDispatcher, EventDispatcher>();
|
||||
|
||||
services.Configure<ApiBehaviorOptions>(options =>
|
||||
{
|
||||
options.SuppressModelStateInvalidFilter = true;
|
||||
});
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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<AppOptions>()
|
||||
.Bind(configuration.GetSection(nameof(AppOptions)))
|
||||
.ValidateDataAnnotations();
|
||||
|
||||
services.AddScoped<ICurrentUserProvider, CurrentUserProvider>();
|
||||
services.AddTransient<IEventMapper, EventMapper>();
|
||||
services.AddScoped<IEventMapper, EventMapper>();
|
||||
services.AddScoped<IEventDispatcher, EventDispatcher>();
|
||||
|
||||
services.Configure<ApiBehaviorOptions>(options =>
|
||||
{
|
||||
options.SuppressModelStateInvalidFilter = true;
|
||||
});
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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<AppOptions>()
|
||||
.Bind(configuration.GetSection(nameof(AppOptions)))
|
||||
.ValidateDataAnnotations();
|
||||
|
||||
services.AddTransient<IEventMapper, EventMapper>();
|
||||
services.AddScoped<IEventMapper, EventMapper>();
|
||||
services.AddScoped<IEventDispatcher, EventDispatcher>();
|
||||
|
||||
services.Configure<ApiBehaviorOptions>(options =>
|
||||
{
|
||||
options.SuppressModelStateInvalidFilter = true;
|
||||
});
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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<AppOptions>()
|
||||
.Bind(configuration.GetSection(nameof(AppOptions)))
|
||||
.ValidateDataAnnotations();
|
||||
|
||||
services.AddScoped<ICurrentUserProvider, CurrentUserProvider>();
|
||||
services.AddTransient<IEventMapper, EventMapper>();
|
||||
services.AddScoped<IEventMapper, EventMapper>();
|
||||
services.AddScoped<IEventDispatcher, EventDispatcher>();
|
||||
|
||||
services.Configure<ApiBehaviorOptions>(options =>
|
||||
{
|
||||
options.SuppressModelStateInvalidFilter = true;
|
||||
});
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user