Refactor properties and add JsonIgnore for .NET builds

Refactored Receiver and Annotations property declarations for clarity and conciseness. Added [JsonIgnore] attributes to Top and Left properties under .NET builds to exclude them from JSON serialization, using #if NET directives. Replaced previous #if NETFRAMEWORK logic to clarify platform-specific behavior.
This commit is contained in:
2026-02-23 17:06:50 +01:00
parent b01c17ab18
commit 41cca7fa64

View File

@@ -4,6 +4,9 @@ using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using EnvelopeGenerator.Domain.Interfaces.Auditing;
#if NET
using System.Text.Json.Serialization;
#endif
#if NETFRAMEWORK
using System.Collections.Generic;
#endif
@@ -109,22 +112,25 @@ namespace EnvelopeGenerator.Domain.Entities
#if nullable
?
#endif
Receiver
{ get; set; }
Receiver { get; set; }
public virtual IEnumerable<ElementAnnotation>
#if nullable
?
#endif
Annotations
{ get; set; }
Annotations { get; set; }
#if NETFRAMEWORK
#if NET
[JsonIgnore]
#endif
[NotMapped]
public double Top => Math.Round(Y, 5);
#if NET
[JsonIgnore]
#endif
[NotMapped]
public double Left => Math.Round(X, 5);
#endif
}
}