public async Task <IActionResult> CreateCommentAsync([FromBody] TaskCommentDetailRequest request) { try { var blRequestMapped = _mapper.Map <TaskCommentDetailRequest, BlTaskCommentDetailRequest>(request); await _businessLogic.CreateCommentAsync(blRequestMapped); return(Ok(request)); } catch (Exception e) { return(BadRequest(e.Message)); } }
public static void CreateComment(string baseUrl, TaskCommentDetailRequest request) { try { _client = new RestClient(baseUrl); var apiRequest = new RestRequest(Method.POST) { Resource = "/api/TaskApi/CreateCommentAsync", RequestFormat = DataFormat.Json }; apiRequest.AddBody(request); var response = _client.Execute(apiRequest); //var data = JsonConvert.DeserializeObject<TaskListResponseDetail>(response.Content); //return data; } catch (Exception e) { throw new Exception(e.Message); } }
public IActionResult CreateComment([FromBody] TaskCommentDetailRequest requestComment) { TaskAPI.CreateComment($"http://{Request.Host}", requestComment); return(Ok(requestComment)); }