コード例 #1
0
        /// <summary>
        /// Update an existing artist
        /// </summary>
        /// <param name="request"><see cref="UpdateArtist"/> request</param>
        /// <returns><see cref="ArtistResponse"/> Response</returns>
        public ArtistResponse Put(UpdateArtist request)
        {
            this.Logger.Info("Update an existing artist");

            var domainArtist = this.ArtistRepository.GetById(request.Id);
            if (domainArtist == null)
            {
                Response.StatusCode = (int)HttpStatusCode.NotFound;
                return null;
            }

            return this.ArtistMapper.ToArtistResponse(this.ArtistRepository.Update(this.ArtistMapper.ToArtist(request)));
        }
コード例 #2
0
 /// <summary>
 /// Mapping for Update artist request
 /// </summary>
 /// <param name="request">Artist request</param>
 /// <returns>An Artist</returns>
 public Artist ToArtist(UpdateArtist request)
 {
     LogManager.GetLogger("").Info("Mapping for Update artist request");
     return Mapper.Map<Artist>(request);
 }