Implementiere WithMessage und WithMessageKey Methoden in IServiceMessage
Methoden hinzugefügt, um Nachrichten direkt oder über Enum-Schlüssel hinzuzufügen, unterstützt Methodenverkettung in IServiceMessage.
This commit is contained in:
@@ -17,5 +17,20 @@
|
||||
/// success notifications, or other relevant information related to the operation's outcome.
|
||||
/// </summary>
|
||||
List<string> Messages { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Adds a new message to the collection of service messages.
|
||||
/// </summary>
|
||||
/// <param name="message">The message to add.</param>
|
||||
/// <returns>The current instance of IServiceMessage, allowing for method chaining.</returns>
|
||||
IServiceMessage WithMessage(string message);
|
||||
|
||||
/// <summary>
|
||||
/// Adds a message corresponding to the specified message key to the collection of service messages.
|
||||
/// This method uses the string representation of the enum value as the message.
|
||||
/// </summary>
|
||||
/// <param name="messageKey">The enum value representing the message key.</param>
|
||||
/// <returns>The current instance of IServiceMessage, allowing for method chaining.</returns>
|
||||
IServiceMessage WithMessageKey(Enum messageKey);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user