29 lines
727 B
C#
29 lines
727 B
C#
using FluentValidation;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using System.Reflection;
|
|
|
|
namespace Sufi.Demo.PeopleDirectory.Application.Extensions
|
|
{
|
|
public static class ServiceCollectionExtensions
|
|
{
|
|
public static IServiceCollection AddApplicationLayer(this IServiceCollection services, string licenseKey)
|
|
{
|
|
services.AddAutoMapper(config =>
|
|
{
|
|
config.LicenseKey = licenseKey;
|
|
config.AddMaps(Assembly.GetExecutingAssembly());
|
|
});
|
|
|
|
services.AddMediatR(config =>
|
|
{
|
|
config.LicenseKey = licenseKey;
|
|
config.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly());
|
|
});
|
|
|
|
services.AddValidatorsFromAssembly(Assembly.GetExecutingAssembly());
|
|
|
|
return services;
|
|
}
|
|
}
|
|
}
|