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

54 lines
1.5 KiB
C#
Raw Permalink Normal View History

2019-11-28 17:38:26 +00:00
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
{
2019-11-28 17:38:26 +00:00
[InverseProperty("Genre")]
public virtual ICollection<ArtistGenre> Artists { get; set; }
2018-12-23 21:36:38 +00:00
2019-11-28 17:38:26 +00:00
[InverseProperty("Genre")]
public virtual ICollection<Comment> Comments { get; set; }
2019-06-28 21:24:32 +00:00
2019-11-10 14:48:07 +00:00
[Column("name")]
2019-11-28 17:38:26 +00:00
[MaxLength(100)]
2019-11-10 14:48:07 +00:00
[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-28 17:38:26 +00:00
[Column("normalizedName")]
[MaxLength(100)]
public string NormalizedName { get; set; }
2019-11-28 17:38:26 +00:00
[InverseProperty("Genre")]
public virtual ICollection<ReleaseGenre> Releases { get; set; }
2019-07-03 16:21:29 +00:00
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
}