public UpdateContactMsgEntity MapUpdateContactMsgEntity(UpdateContactApiModel updateContactApiModel, string id)
 {
     return(new UpdateContactMsgEntity
     {
         Id = id,
         CreatedBy = updateContactApiModel.CreatedByOrModifiedBy,
         ModifiedBy = updateContactApiModel.CreatedByOrModifiedBy,
         CustomerName = updateContactApiModel.CustomerName,
         EmailAddress = updateContactApiModel.EmailAddress,
         Message = updateContactApiModel.Message,
         Subject = updateContactApiModel.Subject
     });
 }
コード例 #2
0
 public ActionResult Put(string id, [FromBody] UpdateContactApiModel updateContactApiModel)
 {
     try
     {
         var updateContactMsgEntity = contactServiceControllerMapper.MapUpdateContactMsgEntity(updateContactApiModel, id);
         var errorMessages          = contactService.UpdateContact(updateContactMsgEntity);
         if (errorMessages.IsEmpty())
         {
             return(Ok());
         }
         return(StatusCode(400, errorMessages.ToApiErrorMessage()));
     }
     catch (Exception ex)
     {
         //TODO: log error
         return(StatusCode(500, contactServiceErrorCode.InternalError));
     }
 }