31 lines
835 B
C#
31 lines
835 B
C#
|
// <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; }
|
||
|
}
|