2020-03-24 17:31:34 +01:00
|
|
|
|
using System.Reflection;
|
|
|
|
|
using MediatR;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
2020-04-14 13:44:07 +02:00
|
|
|
|
using ModernKeePass.Application.Common.Behaviors;
|
2020-03-24 17:31:34 +01:00
|
|
|
|
|
|
|
|
|
namespace ModernKeePass.Application
|
|
|
|
|
{
|
|
|
|
|
public static class DependencyInjection
|
|
|
|
|
{
|
|
|
|
|
public static IServiceCollection AddApplication(this IServiceCollection services)
|
|
|
|
|
{
|
|
|
|
|
var assembly = typeof(DependencyInjection).GetTypeInfo().Assembly;
|
|
|
|
|
services.AddMediatR(assembly);
|
2020-04-27 11:14:29 +02:00
|
|
|
|
services.AddTransient(typeof(IPipelineBehavior<,>), typeof(DirtyStatusBehavior<,>));
|
2020-06-10 13:38:04 +02:00
|
|
|
|
|
2020-03-24 17:31:34 +01:00
|
|
|
|
return services;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|