Ejemplo n.º 1
0
 public ActionResult UpdateTask([FromBody] UpdateTaskDetailRequest request)
 {
     try
     {
         TaskAPI.UpdateTaskDetail($"http://{Request.Host}", request);
         return(Ok(request));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Ejemplo n.º 2
0
        public async Task <IActionResult> UpdateTaskDetail([FromBody] UpdateTaskDetailRequest request)
        {
            try
            {
                //var blResponse = await _businessLogic.GetTaskById(id);
                var blRequest = _mapper.Map <UpdateTaskDetailRequest, BlUpdateTaskDetail>(request);
                await _businessLogic.UpdateAsync(blRequest);

                return(Ok(request));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
Ejemplo n.º 3
0
        public static void UpdateTaskDetail(string baseUrl, UpdateTaskDetailRequest request)
        {
            try
            {
                _client = new RestClient(baseUrl);
                var apiRequest = new RestRequest(Method.PUT)
                {
                    Resource      = "/api/TaskApi/UpdateTaskDetail",
                    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);
            }
        }