mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 23:50:18 -04:00
Correct package version installed
Dependency injection works Project renaming WIP replacement of services with CQRS
This commit is contained in:
32
ModernKeePass.Application/ApplicationModule.cs
Normal file
32
ModernKeePass.Application/ApplicationModule.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System.Reflection;
|
||||
using Autofac;
|
||||
using AutoMapper;
|
||||
using MediatR;
|
||||
using ModernKeePass.Application.Common.Mappings;
|
||||
using Module = Autofac.Module;
|
||||
|
||||
namespace ModernKeePass.Application
|
||||
{
|
||||
public class ApplicationModule: Module
|
||||
{
|
||||
protected override void Load(ContainerBuilder builder)
|
||||
{
|
||||
// Register Automapper profiles
|
||||
builder.RegisterType<MappingProfiles>().As<Profile>();
|
||||
|
||||
// Register Mediatr
|
||||
builder
|
||||
.RegisterType<Mediator>()
|
||||
.As<IMediator>()
|
||||
.InstancePerLifetimeScope();
|
||||
|
||||
// request & notification handlers
|
||||
builder.Register<SingleInstanceFactory>(context =>
|
||||
{
|
||||
var c = context.Resolve<IComponentContext>();
|
||||
return t => c.Resolve(t);
|
||||
});
|
||||
builder.RegisterAssemblyTypes(typeof(ApplicationModule).GetTypeInfo().Assembly).AsImplementedInterfaces();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user