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

24 lines
799 B
C#
Raw Normal View History

2019-06-28 21:24:32 +00:00
using Roadie.Library.Enums;
using System.ComponentModel.DataAnnotations.Schema;
namespace Roadie.Library.Data
{
public partial class Comment
{
[NotMapped]
public CommentType CommentType
{
get
{
2019-07-03 16:21:29 +00:00
if (ArtistId.HasValue) return CommentType.Artist;
if (CollectionId.HasValue) return CommentType.Collection;
if (GenreId.HasValue) return CommentType.Genre;
if (LabelId.HasValue) return CommentType.Label;
if (PlaylistId.HasValue) return CommentType.Playlist;
if (ReleaseId.HasValue) return CommentType.Release;
if (TrackId.HasValue) return CommentType.Track;
2019-06-28 21:24:32 +00:00
return CommentType.Unknown;
}
}
}
2019-07-03 16:21:29 +00:00
}