roadie/Roadie.Api.Library/Models/GenreList.cs
2019-11-24 15:58:38 -06:00

32 lines
No EOL
1,006 B
C#

using System;
namespace Roadie.Library.Models
{
[Serializable]
public sealed class GenreList : EntityInfoModelBase
{
public int? ArtistCount { get; set; }
public DataToken Genre { get; set; }
public int? ReleaseCount { get; set; }
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
};
}
}
}