LANCommander/LANCommander.Server.Data/Models/Media.cs

51 lines
1.4 KiB
C#
Raw Permalink Normal View History

2024-06-19 19:36:04 -05:00
using LANCommander.SDK.Enums;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
2024-08-04 18:44:33 -05:00
namespace LANCommander.Server.Data.Models
{
[Table("Media")]
public class Media : BaseModel
{
public Guid FileId { get; set; }
2024-06-19 21:35:01 -05:00
[MaxLength(64)]
public string? Name { get; set; }
public MediaType Type { get; set; }
[MaxLength(2048)]
public string? SourceUrl { get; set; }
[MaxLength(255)]
public string? MimeType { get; set; }
[MaxLength(8)]
public string Crc32 { get; set; }
public int SortOrder { get; set; }
2024-11-27 01:51:47 -06:00
public Media? Thumbnail { get; set; }
[JsonIgnore]
2024-11-27 01:51:47 -06:00
public Media? Parent { get; set; }
public Guid StorageLocationId { get; set; }
[JsonIgnore]
[ForeignKey(nameof(StorageLocationId))]
[InverseProperty(nameof(StorageLocation.Media))]
2024-11-27 01:51:47 -06:00
public StorageLocation StorageLocation { get; set; }
2024-01-15 02:20:35 -06:00
public Guid? GameId { get; set; }
[JsonIgnore]
[ForeignKey(nameof(GameId))]
[InverseProperty("Media")]
2024-11-27 01:51:47 -06:00
public Game? Game { get; set; }
2024-01-15 02:20:35 -06:00
public Guid? UserId { get; set; }
[JsonIgnore]
[ForeignKey(nameof(UserId))]
[InverseProperty("Media")]
2024-11-27 01:51:47 -06:00
public User? User { get; set; }
}
}