Esempio n. 1
0
 public async Task <JsonResult> AddItem()
 {
     using (var reader = new System.IO.StreamReader(Request?.Body))
     {
         var item  = JsonConvert.DeserializeObject <ToDoItem>(await reader.ReadToEndAsync());
         var token = HttpContext.RequestAborted;
         return(new JsonResult(await _toDoList.AddItemAsync(item, token)));
     }
 }