Beispiel #1
0
 public IActionResult UpdateCommand(int id, [FromBody] JObject jObject) //
 {
     try
     {
         _telemetryClient.TrackEvent("Logging - in UpdateCommand (controller) | telemetry");
         _logger.LogInformation("Logging - in UpdateCommand (controller) | serilog");
         //var tarun = jObject.ToString();
         //DeserializeObject = json->obj
         var dataKeyValue = JsonConvert.DeserializeObject <Dictionary <string, object> >(jObject.ToString());
         var response     = _commander.UpdateCommand(id, dataKeyValue);
         var result       = _mapper.Mapper.Map <Command, CommandDTO>(response);
         return(new OkObjectResult(result));
     }
     catch (Exception ex)
     {
         return(StatusCode(500, ex.Message));
     }
 }