astral-api/Astral.ApiServer/Models/Common/DataResponseModel.cs

31 lines
835 B
C#
Raw Permalink Normal View History

2024-12-15 17:06:14 +01:00
// <copyright file="DataResponseModel.cs" company="alveus.dev">
// Copyright (c) alveus.dev. All rights reserved. Licensed under the MIT License.
// </copyright>
using System.Text.Json.Serialization;
namespace Astral.ApiServer.Models.Common;
/// <summary>
/// Success with data response.
/// </summary>
public class DataResponseModel<TDataType> : ResponseModel
{
/// <summary>
/// Initializes a new instance of the <see cref="DataResponseModel{TDataType}"/> class.
/// </summary>
/// <param name="data">Instance of <see cref="TDataType"/>.</param>
public DataResponseModel(TDataType data)
{
Status = "success";
Success = true;
Data = data;
}
/// <summary>
/// The data response.
/// </summary>
[JsonPropertyName("data")]
public TDataType Data { get; set; }
}