Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. public class Status
  2. {
  3. public string Content {get; set;}
  4. public string Publisher {get; set;}
  5. public List<string> Tags {get; set;}
  6. }
  7.  
  8. {
  9. "content":"this is my baby dog",
  10. "publisher":"someone"
  11. "tags":[ "tag1", "tag2" ]
  12. }
  13.  
  14. [HttpPost]
  15. public IActionResult Publish([FromBody] Status status)
  16. {
  17. // status should be deserialized now
  18. }
  19.  
  20. {
  21. "content":"this is my baby dog",
  22. "publisher":"someone",
  23. "tags":[ "tag1", "tag2" ]
  24. }
  25.  
  26. {
  27. "content":"this is my baby dog",
  28. "publisher":"someone",
  29. "tags":[ {"tag1":"tag1"}, {"tag2":"tag2"} ]
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement