mirror of
https://github.com/C9Glax/tranga.git
synced 2025-05-21 13:43:01 +02:00
24 lines
635 B
C#
24 lines
635 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace API.Schema;
|
|
|
|
[PrimaryKey("LinkId")]
|
|
public class Link(string linkProvider, string linkUrl)
|
|
{
|
|
[StringLength(64)]
|
|
[Required]
|
|
public string LinkId { get; init; } = TokenGen.CreateToken(typeof(Link), linkProvider, linkUrl);
|
|
[StringLength(64)]
|
|
[Required]
|
|
public string LinkProvider { get; init; } = linkProvider;
|
|
[StringLength(2048)]
|
|
[Required]
|
|
[Url]
|
|
public string LinkUrl { get; init; } = linkUrl;
|
|
|
|
public override string ToString()
|
|
{
|
|
return $"{LinkId} {LinkProvider} {LinkUrl}";
|
|
}
|
|
} |