mirror of
https://github.com/C9Glax/tranga.git
synced 2025-09-10 11:58:19 +02:00
Use DTOs to return API requests instead of Database Schema types.
Make use of IHttpStatusCodeResults
This commit is contained in:
18
API/Controllers/DTOs/Identifiable.cs
Normal file
18
API/Controllers/DTOs/Identifiable.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace API.Controllers.DTOs;
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="API.Schema.Identifiable"/>
|
||||
/// </summary>
|
||||
public record Identifiable(string Key)
|
||||
{
|
||||
/// <summary>
|
||||
/// Unique Identifier of the DTO
|
||||
/// </summary>
|
||||
[Required]
|
||||
[Description("Unique Identifier of the DTO")]
|
||||
[StringLength(TokenGen.MaximumLength, MinimumLength = TokenGen.MinimumLength)]
|
||||
public string Key { get; init; } = Key;
|
||||
}
|
Reference in New Issue
Block a user