-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlugin.cs
29 lines (26 loc) · 1.15 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.B2PCentral.Services;
using Microsoft.Extensions.DependencyInjection;
namespace BTCPayServer.Plugins.B2PCentral;
public class Plugin : BaseBTCPayServerPlugin
{
public override IBTCPayServerPlugin.PluginDependency[] Dependencies { get; } =
{
new IBTCPayServerPlugin.PluginDependency { Identifier = nameof(BTCPayServer), Condition = ">=1.12.0" }
};
public override void Execute(IServiceCollection services)
{
services.AddSingleton<IUIExtension>(new UIExtension("B2PCentralPluginHeaderNav", "header-nav"));
services.AddHostedService<ApplicationPartsLogger>();
services.AddHostedService<PluginMigrationRunner>();
services.AddSingleton<B2PCentralPluginService>();
services.AddSingleton<B2PCentralPluginDbContextFactory>();
services.AddDbContext<B2PCentralPluginDbContext>((provider, o) =>
{
var factory = provider.GetRequiredService<B2PCentralPluginDbContextFactory>();
factory.ConfigureBuilder(o);
});
}
}