-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlugin.cs
29 lines (26 loc) · 1.14 KB
/
Plugin.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using BTCPayServer.Abstractions.Contracts;
using BTCPayServer.Abstractions.Models;
using BTCPayServer.Abstractions.Services;
using BTCPayServer.Plugins.Dolibarr.Services;
using Microsoft.Extensions.DependencyInjection;
namespace BTCPayServer.Plugins.Dolibarr;
public class Plugin : BaseBTCPayServerPlugin
{
public override IBTCPayServerPlugin.PluginDependency[] Dependencies { get; } = new[]
{
new IBTCPayServerPlugin.PluginDependency { Identifier = nameof(BTCPayServer), Condition = ">=1.8.2" }
};
public override void Execute(IServiceCollection services)
{
services.AddSingleton<IUIExtension>(new UIExtension("DolibarrPluginHeaderNav", "header-nav"));
services.AddHostedService<ApplicationPartsLogger>();
services.AddHostedService<PluginMigrationRunner>();
services.AddSingleton<DolibarrService>();
services.AddSingleton<DolibarrDbContextFactory>();
services.AddDbContext<DolibarrDbContext>((provider, o) =>
{
DolibarrDbContextFactory factory = provider.GetRequiredService<DolibarrDbContextFactory>();
factory.ConfigureBuilder(o);
});
}
}