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