Skip to content

Commit

Permalink
Easy serializer reg func
Browse files Browse the repository at this point in the history
  • Loading branch information
aritchie committed Oct 9, 2024
1 parent f2b7ff1 commit e14b068
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Shiny.Mediator.AppSupport/AppSupportExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Shiny.Mediator.Infrastructure;
using Shiny.Mediator.Middleware;
Expand All @@ -7,6 +8,13 @@ namespace Shiny.Mediator;

public static class AppSupportExtensions
{
public static ShinyConfigurator SetSerializer<TSerializer>(this ShinyConfigurator cfg) where TSerializer : class, ISerializerService
{
cfg.Services.AddSingleton<ISerializerService, TSerializer>();
return cfg;
}


/// <summary>
/// Adds standard app support middleware - offline, replay stream, & user notification
/// </summary>
Expand Down

0 comments on commit e14b068

Please sign in to comment.