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

40 lines
980 B
C#
Raw Normal View History

2018-11-02 22:20:36 +00:00
using Roadie.Library.Identity;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Roadie.Library.Data
{
[Table("userartist")]
2019-07-03 16:21:29 +00:00
public class UserArtist : EntityBase
2018-11-02 22:20:36 +00:00
{
2019-11-28 17:38:26 +00:00
[ForeignKey(nameof(ArtistId))]
[InverseProperty("UserArtists")]
public virtual Artist Artist { get; set; }
2018-11-02 22:20:36 +00:00
2019-11-28 17:38:26 +00:00
[Column("artistId")]
[Required]
public int ArtistId { get; set; }
2018-11-02 22:20:36 +00:00
2019-11-28 17:38:26 +00:00
[Column("isDisliked")]
public bool? IsDisliked { get; set; }
2018-11-02 22:20:36 +00:00
2019-11-28 17:38:26 +00:00
[Column("isFavorite")]
public bool? IsFavorite { get; set; }
2018-11-02 22:20:36 +00:00
2019-11-28 17:38:26 +00:00
[Column("rating")]
public short Rating { get; set; }
2018-11-02 22:20:36 +00:00
2019-11-28 17:38:26 +00:00
[ForeignKey(nameof(UserId))]
[InverseProperty("ArtistRatings")]
public virtual User User { get; set; }
2018-11-02 22:20:36 +00:00
2019-11-28 17:38:26 +00:00
[Column("userId")]
[Required]
public int UserId { get; set; }
2018-12-15 04:19:52 +00:00
public UserArtist()
{
2019-07-03 16:21:29 +00:00
Rating = 0;
2018-12-15 04:19:52 +00:00
}
2018-11-02 22:20:36 +00:00
}
}