Flag-Enum implementiert und IServiceMessage mit Flag-Unterstützung aktualisiert

- Flag-Enum mit Null und SecurityBreach definiert.
- Flag-Eigenschaft und HasFlag-Methode zu IServiceMessage hinzugefügt.
This commit is contained in:
Developer 02
2024-04-22 10:21:39 +02:00
parent fae750c1d8
commit 4dea6b9b00
34 changed files with 51 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
using System.Text.Json.Serialization;
namespace DigitalData.Core.Contracts.Application
{
{
/// <summary>
/// Defines a structured format for service messages, categorizing them into success indicators and various types of messages.
/// This interface segregates messages into client-facing messages and different levels of logging messages, facilitating targeted communications and diagnostics.
@@ -14,6 +14,21 @@ namespace DigitalData.Core.Contracts.Application
/// </summary>
bool IsSuccess { get; set; }
/// <summary>
/// Gets or sets the flag that indicates the specific status type of the service operation.
/// This flag helps in categorizing the state of the operation more granularly.
/// </summary>
[JsonIgnore]
Enum Flag { get; set; }
/// <summary>
/// Checks if the current service message's flag matches the specified flag.
/// This method is useful for conditional logic based on the status of the operation.
/// </summary>
/// <param name="flag">The flag to check against the current service message's flag.</param>
/// <returns>true if the flags match; otherwise, false.</returns>
public bool HasFlag(Enum flag) => Flag.ToString() == flag.ToString();
/// <summary>
/// [Obsolete("Deprecated: Use ClientMessages instead.")]
/// Gets a collection of messages associated with the service operation. These messages can be error descriptions,