refactor(CreateAnnotationCommand): make JsonSerializerOptions static.

This commit is contained in:
tekh 2025-10-14 09:34:59 +02:00
parent ecc7552951
commit f13a2434f7

View File

@ -15,21 +15,19 @@ namespace EnvelopeGenerator.Application.Annotations.Commands;
/// </summary> /// </summary>
public record CreateAnnotationCommand : EnvelopeReceiverQueryBase, IRequest<IEnumerable<Signature>> public record CreateAnnotationCommand : EnvelopeReceiverQueryBase, IRequest<IEnumerable<Signature>>
{ {
/// <summary> private static readonly JsonSerializerOptions SerializerOptions = new()
///
/// </summary>
public CreateAnnotationCommand()
{
_lazyPSPDFKitInstant = new(() =>
{
var options = new JsonSerializerOptions
{ {
PropertyNameCaseInsensitive = true, PropertyNameCaseInsensitive = true,
PropertyNamingPolicy = null PropertyNamingPolicy = null
}; };
return JsonSerializer.Deserialize<dynamic>(PSPDFKitInstantJSON, options) ?? new ExpandoObject(); /// <summary>
}); ///
/// </summary>
public CreateAnnotationCommand()
{
_lazyPSPDFKitInstant = new(()
=> JsonSerializer.Deserialize<dynamic>(PSPDFKitInstantJSON, SerializerOptions) ?? new ExpandoObject());
} }
/// <summary> /// <summary>