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:
19
DigitalData.Core.Application/Flag.cs
Normal file
19
DigitalData.Core.Application/Flag.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace DigitalData.Core.Application
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines flags that indicate specific types of status or conditions in a service operation.
|
||||
/// These flags help in categorizing and identifying specific circumstances or issues that may arise during execution.
|
||||
/// </summary>
|
||||
public enum Flag
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates that no specific condition or status is associated with the service operation.
|
||||
/// </summary>
|
||||
Null,
|
||||
|
||||
/// <summary>
|
||||
/// Indicates a security breach or vulnerability has been detected during the service operation.
|
||||
/// </summary>
|
||||
SecurityBreach
|
||||
}
|
||||
}
|
||||
@@ -46,6 +46,21 @@ namespace DigitalData.Core.Application
|
||||
/// </summary>
|
||||
public bool IsSuccess { get; set; } = false;
|
||||
|
||||
/// <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]
|
||||
public Enum Flag { get; set; } = Application.Flag.Null;
|
||||
|
||||
/// <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.
@@ -1 +1 @@
|
||||
1204f54a36145ece1945026f8fb6c0371ee8b734
|
||||
cab2f6eb8a1a8332777e30db94aff8080085a4c2
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user