Updated Song model to include ArtistId, Updated Artist Model, and partially implemented Artist API endpoint functionality. I left TODO's on where to pick up. #19, #21, #26
This commit is contained in:
@@ -24,9 +24,15 @@ namespace Icarus.Models.Context
|
||||
modelBuilder.Entity<Song>()
|
||||
.ToTable("Song")
|
||||
.HasOne(s => s.Album)
|
||||
.WithMany(a => a.Songs)
|
||||
.WithMany(al => al.Songs)
|
||||
.HasForeignKey(s => s.AlbumId)
|
||||
.HasConstraintName("ForeignKey_Song_Album");
|
||||
|
||||
modelBuilder.Entity<Song>()
|
||||
.HasOne(sa => sa.SongArtist)
|
||||
.WithMany(ar => ar.Songs)
|
||||
.HasForeignKey(s => s.ArtistId)
|
||||
.HasConstraintName("ForeignKey_Song_Artist");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user