Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. this._http.post<any>(this.baseUrl + 'api/Tasks/AddTask', { id: 1, title: 'dddd', description: 'vvvv' }).subscribe(
  2. (res) => console.log(res),
  3. (err) => console.log(err)
  4. );
  5.  
  6. [HttpPost("[action]")]
  7. public JsonResult AddTask(TaskDTO task)
  8. {
  9. return Json(new { result = "ok" });
  10. }
  11.  
  12. public class TaskDTO
  13. {
  14. public int id { get; set; }
  15.  
  16. public string title { get; set; }
  17.  
  18. public string description { get; set; }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement