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>>
{ {
private static readonly JsonSerializerOptions SerializerOptions = new()
{
PropertyNameCaseInsensitive = true,
PropertyNamingPolicy = null
};
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public CreateAnnotationCommand() public CreateAnnotationCommand()
{ {
_lazyPSPDFKitInstant = new(() => _lazyPSPDFKitInstant = new(()
{ => JsonSerializer.Deserialize<dynamic>(PSPDFKitInstantJSON, SerializerOptions) ?? new ExpandoObject());
var options = new JsonSerializerOptions
{
PropertyNameCaseInsensitive = true,
PropertyNamingPolicy = null
};
return JsonSerializer.Deserialize<dynamic>(PSPDFKitInstantJSON, options) ?? new ExpandoObject();
});
} }
/// <summary> /// <summary>