26 lines
954 B
C#
26 lines
954 B
C#
|
using Autofac;
|
|||
|
|
|||
|
namespace Piwigo.Client.Autofac;
|
|||
|
|
|||
|
public sealed class PiwigoModule : Module
|
|||
|
{
|
|||
|
private readonly IPiwigoConfiguration _configuration;
|
|||
|
|
|||
|
public PiwigoModule(IPiwigoConfiguration configuration)
|
|||
|
{
|
|||
|
_configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
|
|||
|
}
|
|||
|
|
|||
|
protected override void Load(ContainerBuilder builder)
|
|||
|
{
|
|||
|
base.Load(builder);
|
|||
|
|
|||
|
builder.RegisterInstance(() => _configuration).AsImplementedInterfaces();
|
|||
|
builder.RegisterType<PiwigoContext>().AsImplementedInterfaces().InstancePerLifetimeScope();
|
|||
|
builder.RegisterType<AlbumApi>().AsImplementedInterfaces();
|
|||
|
builder.RegisterType<ImageApi>().AsImplementedInterfaces();
|
|||
|
builder.RegisterType<SessionApi>().AsImplementedInterfaces();
|
|||
|
builder.RegisterType<TagApi>().AsImplementedInterfaces();
|
|||
|
builder.RegisterType<PiwigoClient>().AsImplementedInterfaces();
|
|||
|
}
|
|||
|
}
|