mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
19 lines
599 B
C#
19 lines
599 B
C#
|
|
using Autofac;
|
|||
|
|
using Autofac.Extensions.DependencyInjection;
|
|||
|
|
|
|||
|
|
using Microsoft.Extensions.DependencyInjection;
|
|||
|
|
|
|||
|
|
namespace PluralKit.Core
|
|||
|
|
{
|
|||
|
|
public class DataStoreModule: Module
|
|||
|
|
{
|
|||
|
|
protected override void Load(ContainerBuilder builder)
|
|||
|
|
{
|
|||
|
|
builder.RegisterType<DbConnectionCountHolder>().SingleInstance();
|
|||
|
|
builder.RegisterType<Database>().As<IDatabase>().SingleInstance();
|
|||
|
|
builder.RegisterType<ModelRepository>().AsSelf().SingleInstance();
|
|||
|
|
|
|||
|
|
builder.Populate(new ServiceCollection().AddMemoryCache());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|