21 lines
708 B
C#
21 lines
708 B
C#
using FluentValidation;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using NTP.Application.Common;
|
|
|
|
namespace NTP.Application;
|
|
|
|
public static class DependencyInjection
|
|
{
|
|
/// <summary>
|
|
/// Convention based: *Service classes are registered against I*Service (scoped) and all
|
|
/// FluentValidation validators are discovered. Do NOT add per-slice lines here.
|
|
/// </summary>
|
|
public static IServiceCollection AddApplication(this IServiceCollection services)
|
|
{
|
|
var assembly = typeof(DependencyInjection).Assembly;
|
|
services.AddValidatorsFromAssembly(assembly, includeInternalTypes: true);
|
|
services.AddConventionalServices(assembly);
|
|
return services;
|
|
}
|
|
}
|