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:
@@ -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,
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user