btcpayserver/BTCPayServer/Services/Notifications/INotificationHandler.cs
Kukks 179520a211 Plugins: Allow creation of independent DbContexts
This allows plugins to create custom dbcontexts, which would be namespaced in the scheme with a prefix. Migrations are supported too and the table would be prefixed too
2020-11-18 12:27:26 +01:00

20 lines
693 B
C#

using System;
using BTCPayServer.Abstractions.Contracts;
namespace BTCPayServer.Services.Notifications
{
public abstract class NotificationHandler<TNotification> : INotificationHandler
{
public abstract string NotificationType { get; }
Type INotificationHandler.NotificationBlobType => typeof(TNotification);
public abstract (string identifier, string name)[] Meta { get; }
void INotificationHandler.FillViewModel(object notification, NotificationViewModel vm)
{
FillViewModel((TNotification)notification, vm);
}
protected abstract void FillViewModel(TNotification notification, NotificationViewModel vm);
}
}