Пример #1
0
        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;
        }
Пример #2
0
        public async Task <IActionResult> UpdateTrack(int trackId, [FromBody] TrackForUpdate track)
        {
            await _mediator.Send(new UpdateTrackCommand(trackId, track));

            return(NoContent());
        }