roadie/Roadie.Api.Library/Data/CommentPartial.cs
2019-07-03 11:21:29 -05:00

24 lines
No EOL
799 B
C#

using Roadie.Library.Enums;
using System.ComponentModel.DataAnnotations.Schema;
namespace Roadie.Library.Data
{
public partial class Comment
{
[NotMapped]
public CommentType CommentType
{
get
{
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;
return CommentType.Unknown;
}
}
}
}