From 1f35534dfbc1e9eb6d3ca9fce36fb6ffece1ff52 Mon Sep 17 00:00:00 2001 From: rockstardev Date: Thu, 11 Jun 2020 18:04:49 -0500 Subject: [PATCH] Providing overridable NotificationType property, direct mapping --- .../Events/Notifications/NotificationEventBase.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/BTCPayServer/Events/Notifications/NotificationEventBase.cs b/BTCPayServer/Events/Notifications/NotificationEventBase.cs index e9ffeeebd..7b60cc533 100644 --- a/BTCPayServer/Events/Notifications/NotificationEventBase.cs +++ b/BTCPayServer/Events/Notifications/NotificationEventBase.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using BTCPayServer.Data; using BTCPayServer.Models.NotificationViewModels; using ExchangeSharp; @@ -12,6 +8,8 @@ namespace BTCPayServer.Events.Notifications { public abstract class NotificationEventBase { + public virtual string NotificationType { get { return GetType().Name; } } + public NotificationData ToData() { var obj = JsonConvert.SerializeObject(this); @@ -19,7 +17,7 @@ namespace BTCPayServer.Events.Notifications var data = new NotificationData { Created = DateTimeOffset.UtcNow, - NotificationType = GetType().Name, + NotificationType = NotificationType, Blob = obj.ToBytesUTF8(), Seen = false };