public TaskPropertyDto UpdateProperty(int taskid, TaskPropertyDto dto) { var entity = AutoMapper.Mapper.Map <TaskProperty>(dto); _taskPropertyRepository.Update(entity); return(AutoMapper.Mapper.Map <TaskPropertyDto>(entity)); }
public IHttpActionResult UpdateProperty(int taskid, [FromBody] TaskPropertyDto dto) { try { var entity = _taskService.GetProperty(taskid, dto.Id); if (entity == null) { return(NotFound()); } return(Ok(_taskService.UpdateProperty(taskid, dto))); } catch (Exception ex) { //LOG //return StatusCode(HttpStatusCode.InternalServerError); return(InternalServerError(new Exception("An unexpected error occured! Please try again later!"))); } }