28 lines
734 B
C#
28 lines
734 B
C#
namespace adas_core.Domain.Models.Responses;
|
|
|
|
/// <summary>
|
|
/// Represents a generic response wrapper that encapsulates a payload of type <typeparamref name="T"/> along with associated response metadata.
|
|
/// </summary>
|
|
/// <typeparam name="T">The type of the payload contained within the response.</typeparam>
|
|
public class Response<T>
|
|
{
|
|
public Response()
|
|
{
|
|
}
|
|
|
|
public Response(T data)
|
|
{
|
|
Succeeded = true;
|
|
Message = string.Empty;
|
|
Errors = null;
|
|
Data = data;
|
|
}
|
|
|
|
public T? Data { get; set; }
|
|
public bool? Succeeded { get; set; }
|
|
|
|
public string[]? Errors { get; set; }
|
|
public string? Message { get; set; }
|
|
}
|
|
|
|
public record UpdateResponse<T>(long Changes, T? Data); |