public UpdateTrackCommand(int trackId, TrackForUpdate track) { if (track is null) { throw new ArgumentNullException(nameof(track)); } AlbumId = track.AlbumId; Bytes = track.Bytes; Composer = track.Composer; GenreId = track.GenreId; MediaTypeId = track.MediaTypeId; Milliseconds = track.Milliseconds; Name = track.Name; Price = track.Price; TrackId = trackId; }
public async Task <IActionResult> UpdateTrack(int trackId, [FromBody] TrackForUpdate track) { await _mediator.Send(new UpdateTrackCommand(trackId, track)); return(NoContent()); }