btcpayserver/Plugins/BTCPayServer.Plugins.Test/TestExtension.cs
d11n 68cdd2c2c8
Cleanups: Move test plugin to Plugins subdirectory (#4463)
* Remove unused js-scroll-trigger classes

* Move test plugin to Plugins subdirectory
2022-12-22 15:09:12 +09:00

30 lines
1.2 KiB
C#

using BTCPayServer.Abstractions.Contracts;
using BTCPayServer.Abstractions.Models;
using BTCPayServer.Abstractions.Services;
using BTCPayServer.Plugins.Test.Services;
using Microsoft.Extensions.DependencyInjection;
namespace BTCPayServer.Plugins.Test
{
public class TestPlugin : BaseBTCPayServerPlugin
{
public override string Identifier { get; } = "BTCPayServer.Plugins.Test";
public override string Name { get; } = "Test Plugin!";
public override string Description { get; } = "This is a description of the loaded test extension!";
public override void Execute(IServiceCollection services)
{
services.AddSingleton<IUIExtension>(new UIExtension("TestExtensionNavExtension", "header-nav"));
services.AddHostedService<ApplicationPartsLogger>();
services.AddHostedService<TestPluginMigrationRunner>();
services.AddSingleton<TestPluginService>();
services.AddSingleton<TestPluginDbContextFactory>();
services.AddDbContext<TestPluginDbContext>((provider, o) =>
{
var factory = provider.GetRequiredService<TestPluginDbContextFactory>();
factory.ConfigureBuilder(o);
});
}
}
}