private Artist CreateArtistFromModel(ArtistOutputModel artist) { var newArtist = new Artist { Id = artist.Id, Name = artist.Name, Country = artist.Country, Nickname = artist.Nickname, DateOfBirth = artist.DateOfBirth, }; this.musicArtistsData.Artists.Add(newArtist); this.musicArtistsData.SaveChanges(); return newArtist; }
private void UpdateArtist(ArtistOutputModel artistUpdate, Artist artist) { artist.Name = artistUpdate.Name; artist.Country = artistUpdate.Country; artist.Nickname = artistUpdate.Nickname; artist.DateOfBirth = artistUpdate.DateOfBirth; this.musicArtistsData.SaveChanges(); }