roadie/Roadie.Api.Library/Data/Genre.cs

55 lines
1.6 KiB
C#
Raw Normal View History

2019-11-04 03:19:04 +00:00
using System;
using System.Collections.Generic;
2018-11-02 21:04:49 +00:00
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Roadie.Library.Data
{
[Table("genre")]
public partial class Genre : EntityBase
{
2018-12-23 21:36:38 +00:00
public ICollection<ArtistGenre> Artists { get; set; }
2019-06-28 21:24:32 +00:00
public ICollection<Comment> Comments { get; set; }
2019-11-10 14:48:07 +00:00
[Column("name")]
[MaxLength(100)]
[Required]
public string Name { get; set; }
[Column("sortName")]
[MaxLength(100)]
public string SortName { get; set; }
public string SortNameValue => string.IsNullOrEmpty(SortName) ? Name : SortName;
2019-07-03 16:21:29 +00:00
2019-08-02 20:59:24 +00:00
[Column("description")]
[MaxLength(4000)]
public string Description { get; set; }
[Column("alternateNames", TypeName = "text")]
[MaxLength(65535)]
public string AlternateNames { get; set; }
[Column("tags", TypeName = "text")]
[MaxLength(65535)]
public string Tags { get; set; }
2019-11-04 03:19:04 +00:00
[Obsolete("Images moved to file system")]
2019-08-02 20:59:24 +00:00
[Column("thumbnail", TypeName = "blob")]
[MaxLength(65535)]
public byte[] Thumbnail { get; set; }
[Column("normalizedName")] [MaxLength(100)] public string NormalizedName { get; set; }
2019-07-03 16:21:29 +00:00
public ICollection<ReleaseGenre> Releases { get; set; }
2018-12-23 21:36:38 +00:00
public Genre()
{
2019-07-03 16:21:29 +00:00
Releases = new HashSet<ReleaseGenre>();
Artists = new HashSet<ArtistGenre>();
Comments = new HashSet<Comment>();
2019-08-02 20:59:24 +00:00
Status = Enums.Statuses.Ok;
2018-12-23 21:36:38 +00:00
}
2018-11-02 21:04:49 +00:00
}
2018-11-02 21:11:11 +00:00
}