From f13a2434f7bd73271e69a96b9d1ce42c4a6d74fa Mon Sep 17 00:00:00 2001 From: TekH Date: Tue, 14 Oct 2025 09:34:59 +0200 Subject: [PATCH] refactor(CreateAnnotationCommand): make JsonSerializerOptions static. --- .../Commands/CreateAnnotationCommand.cs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/EnvelopeGenerator.Application/Annotations/Commands/CreateAnnotationCommand.cs b/EnvelopeGenerator.Application/Annotations/Commands/CreateAnnotationCommand.cs index dd333602..9dd0b349 100644 --- a/EnvelopeGenerator.Application/Annotations/Commands/CreateAnnotationCommand.cs +++ b/EnvelopeGenerator.Application/Annotations/Commands/CreateAnnotationCommand.cs @@ -15,21 +15,19 @@ namespace EnvelopeGenerator.Application.Annotations.Commands; /// public record CreateAnnotationCommand : EnvelopeReceiverQueryBase, IRequest> { + private static readonly JsonSerializerOptions SerializerOptions = new() + { + PropertyNameCaseInsensitive = true, + PropertyNamingPolicy = null + }; + /// /// /// public CreateAnnotationCommand() { - _lazyPSPDFKitInstant = new(() => - { - var options = new JsonSerializerOptions - { - PropertyNameCaseInsensitive = true, - PropertyNamingPolicy = null - }; - - return JsonSerializer.Deserialize(PSPDFKitInstantJSON, options) ?? new ExpandoObject(); - }); + _lazyPSPDFKitInstant = new(() + => JsonSerializer.Deserialize(PSPDFKitInstantJSON, SerializerOptions) ?? new ExpandoObject()); } ///