Hinzugefügt WithFlag Methode zu ServiceMessageExtensions für das direkte Setzen von Flags auf IServiceMessage Instanzen.

This commit is contained in:
Developer 02 2024-04-22 10:27:29 +02:00
parent 4dea6b9b00
commit 40c3b6fdc1
11 changed files with 13 additions and 0 deletions

Binary file not shown.

View File

@ -10,6 +10,19 @@ namespace DigitalData.Core.Application
/// </summary>
public static class ServiceMessageExtensions
{
/// <summary>
/// Sets the specified flag on the service message or result, allowing for the categorization of the message based on specific conditions or statuses.
/// </summary>
/// <typeparam name="T">The type of IServiceMessage.</typeparam>
/// <param name="serviceMessage">The service message instance to modify.</param>
/// <param name="flag">The flag to set, indicating a specific condition or status.</param>
/// <returns>The service message instance with the updated flag, facilitating fluent chaining of methods.</returns>
public static T WithFlag<T>(this T serviceMessage, Enum flag) where T : IServiceMessage
{
serviceMessage.Flag = flag;
return serviceMessage;
}
#region ClientMessage
/// <summary>
/// Adds a single client message to the service message.