Guest User

Untitled

a guest
Dec 12th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. [HttpGet]
  2. public JsonResult AddTextFile(string path)
  3. {
  4. if(string.IsNullOrEmpty(path))
  5. {
  6. // return error
  7. }
  8. }
  9.  
  10. [HttpGet]
  11. public JsonResult AddTextFile(MyObject obj) {
  12. if(!ModelState.IsValid) {
  13. // return error
  14. }
  15. }
  16.  
  17. public class MyObject {
  18. [Required]
  19. public string Path { get; set; }
  20. }
Add Comment
Please, Sign In to add comment