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