mirror of
https://github.com/meysamhadeli/booking-microservices.git
synced 2026-04-29 01:04:56 +08:00
commit
0dfd45f33e
@ -1,23 +1,23 @@
|
|||||||
using BuildingBlocks.Core;
|
using BuildingBlocks.Core;
|
||||||
using BuildingBlocks.Utils;
|
using BuildingBlocks.Utils;
|
||||||
using BuildingBlocks.Web;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Configuration;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
namespace Booking.Extensions;
|
namespace Booking.Extensions;
|
||||||
|
|
||||||
public static class CoreExtensions
|
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.AddScoped<ICurrentUserProvider, CurrentUserProvider>();
|
||||||
services.AddTransient<IEventMapper, EventMapper>();
|
services.AddScoped<IEventMapper, EventMapper>();
|
||||||
services.AddScoped<IEventDispatcher, EventDispatcher>();
|
services.AddScoped<IEventDispatcher, EventDispatcher>();
|
||||||
|
|
||||||
|
services.Configure<ApiBehaviorOptions>(options =>
|
||||||
|
{
|
||||||
|
options.SuppressModelStateInvalidFilter = true;
|
||||||
|
});
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,23 +1,23 @@
|
|||||||
using BuildingBlocks.Core;
|
using BuildingBlocks.Core;
|
||||||
using BuildingBlocks.Utils;
|
using BuildingBlocks.Utils;
|
||||||
using BuildingBlocks.Web;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Configuration;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
namespace Flight.Extensions;
|
namespace Flight.Extensions;
|
||||||
|
|
||||||
public static class CoreExtensions
|
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.AddScoped<ICurrentUserProvider, CurrentUserProvider>();
|
||||||
services.AddTransient<IEventMapper, EventMapper>();
|
services.AddScoped<IEventMapper, EventMapper>();
|
||||||
services.AddScoped<IEventDispatcher, EventDispatcher>();
|
services.AddScoped<IEventDispatcher, EventDispatcher>();
|
||||||
|
|
||||||
|
services.Configure<ApiBehaviorOptions>(options =>
|
||||||
|
{
|
||||||
|
options.SuppressModelStateInvalidFilter = true;
|
||||||
|
});
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,21 +1,21 @@
|
|||||||
using BuildingBlocks.Core;
|
using BuildingBlocks.Core;
|
||||||
using BuildingBlocks.Web;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Configuration;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
namespace Identity.Extensions;
|
namespace Identity.Extensions;
|
||||||
|
|
||||||
public static class CoreExtensions
|
public static class CoreExtensions
|
||||||
{
|
{
|
||||||
public static IServiceCollection AddCore(this IServiceCollection services, IConfiguration configuration)
|
public static IServiceCollection AddCore(this IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.AddOptions<AppOptions>()
|
services.AddScoped<IEventMapper, EventMapper>();
|
||||||
.Bind(configuration.GetSection(nameof(AppOptions)))
|
|
||||||
.ValidateDataAnnotations();
|
|
||||||
|
|
||||||
services.AddTransient<IEventMapper, EventMapper>();
|
|
||||||
services.AddScoped<IEventDispatcher, EventDispatcher>();
|
services.AddScoped<IEventDispatcher, EventDispatcher>();
|
||||||
|
|
||||||
|
services.Configure<ApiBehaviorOptions>(options =>
|
||||||
|
{
|
||||||
|
options.SuppressModelStateInvalidFilter = true;
|
||||||
|
});
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,25 +1,23 @@
|
|||||||
using BuildingBlocks.Core;
|
using BuildingBlocks.Core;
|
||||||
using BuildingBlocks.Utils;
|
using BuildingBlocks.Utils;
|
||||||
using BuildingBlocks.Web;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Configuration;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
namespace Passenger.Extensions;
|
namespace Passenger.Extensions;
|
||||||
|
|
||||||
public static class CoreExtensions
|
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.AddScoped<ICurrentUserProvider, CurrentUserProvider>();
|
||||||
services.AddTransient<IEventMapper, EventMapper>();
|
services.AddScoped<IEventMapper, EventMapper>();
|
||||||
services.AddScoped<IEventDispatcher, EventDispatcher>();
|
services.AddScoped<IEventDispatcher, EventDispatcher>();
|
||||||
|
|
||||||
|
services.Configure<ApiBehaviorOptions>(options =>
|
||||||
|
{
|
||||||
|
options.SuppressModelStateInvalidFilter = true;
|
||||||
|
});
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user