roadie/Roadie.Api.Library/Models/GenreList.cs

32 lines
1,006 B
C#
Raw Normal View History

2018-11-15 04:25:40 +00:00
using System;
namespace Roadie.Library.Models
{
[Serializable]
public sealed class GenreList : EntityInfoModelBase
2018-11-15 04:25:40 +00:00
{
2019-07-03 16:21:29 +00:00
public int? ArtistCount { get; set; }
2018-11-15 04:25:40 +00:00
public DataToken Genre { get; set; }
public int? ReleaseCount { get; set; }
2019-08-02 20:59:24 +00:00
public Image Thumbnail { get; set; }
public static GenreList FromDataGenre(Data.Genre genre, Image genreThumbnail, int? artistCount, int? releaseCount)
{
return new GenreList
{
Id = genre.RoadieId,
Genre = new DataToken
{
Text = genre.Name,
Value = genre.RoadieId.ToString()
},
SortName = genre.SortName,
CreatedDate = genre.CreatedDate,
LastUpdated = genre.LastUpdated,
ArtistCount = artistCount,
ReleaseCount = releaseCount,
Thumbnail = genreThumbnail
};
}
2018-11-15 04:25:40 +00:00
}
2019-07-03 16:21:29 +00:00
}