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.
27 lines
682 B
27 lines
682 B
9 months ago
|
using Autofac;
|
||
|
|
||
|
namespace Recyclarr.Platform;
|
||
|
|
||
|
public class PlatformAutofacModule : Module
|
||
|
{
|
||
|
protected override void Load(ContainerBuilder builder)
|
||
|
{
|
||
|
base.Load(builder);
|
||
|
RegisterAppPaths(builder);
|
||
|
}
|
||
|
|
||
|
private static void RegisterAppPaths(ContainerBuilder builder)
|
||
|
{
|
||
|
builder.RegisterType<DefaultAppDataSetup>();
|
||
|
|
||
|
builder.Register(c =>
|
||
|
{
|
||
|
var appData = c.Resolve<AppDataPathProvider>();
|
||
|
var dataSetup = c.Resolve<DefaultAppDataSetup>();
|
||
|
return dataSetup.CreateAppPaths(appData.AppDataPath);
|
||
|
})
|
||
|
.As<IAppPaths>()
|
||
|
.SingleInstance();
|
||
|
}
|
||
|
}
|