From 5ddda4865d4cbffe796d9b6a38bd228ca22e5a8d Mon Sep 17 00:00:00 2001 From: Yuuki Wesp Date: Wed, 4 Dec 2024 17:28:28 +0300 Subject: [PATCH] Add MessagePack formatter and resolver for OrleansExtension Added a new MessagePack formatter and resolver to support serialization in OrleansExtension. --- src/Argon.Api/Features/Orleanse/OrleansExtension.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Argon.Api/Features/Orleanse/OrleansExtension.cs b/src/Argon.Api/Features/Orleanse/OrleansExtension.cs index fad1e69..4b566b6 100644 --- a/src/Argon.Api/Features/Orleanse/OrleansExtension.cs +++ b/src/Argon.Api/Features/Orleanse/OrleansExtension.cs @@ -2,6 +2,7 @@ namespace Argon.Features; using ActualLab.Serialization; using Env; +using MessagePack.Formatters; using MessagePack.Resolvers; using Orleans.Clustering.Kubernetes; using Orleans.Configuration; @@ -17,7 +18,8 @@ public static WebApplicationBuilder AddOrleans(this WebApplicationBuilder builde { var options = MessagePackSerializerOptions.Standard .WithResolver(CompositeResolver.Create( - DynamicEnumAsStringResolver.Instance, + DynamicEnumAsStringResolver.Instance, + EitherFormatterResolver.Instance, StandardResolver.Instance)); MessagePackSerializer.DefaultOptions = options; builder.Services.AddSerializer(x => x.AddMessagePackSerializer(null, null, MessagePackSerializer.DefaultOptions));