You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
581 B
22 lines
581 B
using System.Reflection;
|
|
using Autofac;
|
|
using FluentValidation;
|
|
using Module = Autofac.Module;
|
|
|
|
namespace TrashLib.Config
|
|
{
|
|
public class ConfigAutofacModule : Module
|
|
{
|
|
protected override void Load(ContainerBuilder builder)
|
|
{
|
|
builder.RegisterType<ConfigurationProvider>()
|
|
.As<IConfigurationProvider>()
|
|
.SingleInstance();
|
|
|
|
builder.RegisterAssemblyTypes(Assembly.GetExecutingAssembly())
|
|
.AsClosedTypesOf(typeof(IValidator<>))
|
|
.AsImplementedInterfaces();
|
|
}
|
|
}
|
|
}
|