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

30 lines
774 B
C#
Raw Normal View History

2018-11-02 22:20:36 +00:00
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Roadie.Library.Data
{
[Table("artistGenreTable")]
2019-07-03 16:21:29 +00:00
public class ArtistGenre
2018-11-02 22:20:36 +00:00
{
2019-11-28 17:38:26 +00:00
[Key]
[Column("id")]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { 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("genreId")]
[Required]
public int GenreId { get; set; }
2018-11-02 22:20:36 +00:00
2019-11-28 17:38:26 +00:00
[ForeignKey(nameof(ArtistId))]
[InverseProperty("Genres")]
public virtual Artist Artist { get; set; }
2018-11-02 22:20:36 +00:00
2019-11-28 17:38:26 +00:00
[ForeignKey(nameof(GenreId))]
[InverseProperty("Artists")]
public virtual Genre Genre { get; set; }
2018-11-02 22:20:36 +00:00
}
}