initial commit
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using DigitalData.Core.Contracts.CleanArchitecture.Application;
|
||||
|
||||
namespace DigitalData.Core.CleanArchitecture.Application
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the outcome of a service operation, encapsulating the success or failure status,
|
||||
/// and any associated messages.
|
||||
/// </summary>
|
||||
public class ServiceMessage : IServiceMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the ServiceMessage class with specified success status, and messages.
|
||||
/// </summary>
|
||||
/// <param name="isSuccess">Indicates whether the service operation was successful.</param>
|
||||
/// <param name="data">The data associated with a successful operation.</param>
|
||||
/// <param name="messages">An array of messages related to the operation's outcome.</param>
|
||||
public ServiceMessage(bool isSuccess, params string[] messages)
|
||||
{
|
||||
IsSuccess = isSuccess;
|
||||
Messages = messages.ToList<string>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the service operation was successful.
|
||||
/// </summary>
|
||||
public bool IsSuccess { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a collection of messages associated with the service operation.
|
||||
/// </summary>
|
||||
public List<string> Messages { get; set; } = new List<string>();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user