refactor(annotation): simplify PSPDFKitInstantJSON deserialization in CreateAnnotationCommand
Refactored CreateAnnotationCommand to remove the lazy initialization pattern and replaced it with a direct property setter for PSPDFKitInstantJSON. This simplifies JSON deserialization and removes unnecessary complexity in managing the PSPDFKitInstant object.
This commit is contained in:
parent
e88bd55198
commit
e64ad44b71
@ -24,25 +24,17 @@ public record CreateAnnotationCommand : EnvelopeReceiverQueryBase, IRequest<IEnu
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public CreateAnnotationCommand()
|
||||
[JsonIgnore]
|
||||
public string PSPDFKitInstantJSON
|
||||
{
|
||||
_lazyPSPDFKitInstant = new(()
|
||||
=> JsonSerializer.Deserialize<dynamic>(PSPDFKitInstantJSON, SerializerOptions) ?? new ExpandoObject());
|
||||
set => PSPDFKitInstant = JsonSerializer.Deserialize<dynamic>(value, SerializerOptions) ?? new ExpandoObject();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public string PSPDFKitInstantJSON { get; set; } = null!;
|
||||
|
||||
private readonly Lazy<dynamic> _lazyPSPDFKitInstant;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public ExpandoObject PSPDFKitInstant => _lazyPSPDFKitInstant.Value;
|
||||
public ExpandoObject PSPDFKitInstant { get; set; } = null!;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user