diff --git a/src/Notifications/Startup.cs b/src/Notifications/Startup.cs index ad33798b4..db310288b 100644 --- a/src/Notifications/Startup.cs +++ b/src/Notifications/Startup.cs @@ -49,19 +49,16 @@ namespace Bit.Notifications }); // SignalR + var signalRServerBuilder = services.AddSignalR().AddMessagePackProtocol(options => + { + options.FormatterResolvers = new List() + { + MessagePack.Resolvers.ContractlessStandardResolver.Instance + }; + }); if(!string.IsNullOrWhiteSpace(globalSettings.Notifications?.AzureSignalRConnectionString)) { - services.AddSignalR().AddAzureSignalR(globalSettings.Notifications.AzureSignalRConnectionString); - } - else - { - services.AddSignalR().AddMessagePackProtocol(options => - { - options.FormatterResolvers = new List() - { - MessagePack.Resolvers.ContractlessStandardResolver.Instance - }; - }); + signalRServerBuilder.AddAzureSignalR(globalSettings.Notifications.AzureSignalRConnectionString); } services.AddSingleton(); services.AddSingleton();