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:
25
API/Controllers/DTOs/Link.cs
Normal file
25
API/Controllers/DTOs/Link.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace API.Controllers.DTOs;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="API.Schema.MangaContext.Link"/> DTO
|
||||
/// </summary>
|
||||
public sealed record Link(string Key, string Provider, string Url) : Identifiable(Key)
|
||||
{
|
||||
/// <summary>
|
||||
/// Name of the Provider
|
||||
/// </summary>
|
||||
[Required]
|
||||
[Description("Name of the Provider")]
|
||||
public string Provider { get; init; } = Provider;
|
||||
|
||||
/// <summary>
|
||||
/// Url
|
||||
/// </summary>
|
||||
[Required]
|
||||
[Description("Url")]
|
||||
public string Url { get; init; } = Url;
|
||||
}
|
Reference in New Issue
Block a user