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>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public CreateAnnotationCommand()
|
[JsonIgnore]
|
||||||
|
public string PSPDFKitInstantJSON
|
||||||
{
|
{
|
||||||
_lazyPSPDFKitInstant = new(()
|
set => PSPDFKitInstant = JsonSerializer.Deserialize<dynamic>(value, SerializerOptions) ?? new ExpandoObject();
|
||||||
=> JsonSerializer.Deserialize<dynamic>(PSPDFKitInstantJSON, SerializerOptions) ?? new ExpandoObject());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public string PSPDFKitInstantJSON { get; set; } = null!;
|
public ExpandoObject PSPDFKitInstant { get; set; } = null!;
|
||||||
|
|
||||||
private readonly Lazy<dynamic> _lazyPSPDFKitInstant;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
[JsonIgnore]
|
|
||||||
public ExpandoObject PSPDFKitInstant => _lazyPSPDFKitInstant.Value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user