Guest User

Untitled

a guest
Feb 19th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. // Class that I want to supply
  2. public class User{
  3. public int? Name {get;set;}
  4. public DateTime? Bday {get;set;}
  5. }
  6.  
  7. // My Controller
  8. public async Task<IActionResult> GetUsers([FromBody] User user){
  9. // Do something here
  10. }
  11.  
  12. // My js file axios is already imported and working
  13. async searchUser(){
  14. const user = {
  15. Name: name,
  16. Bday: bday
  17. }
  18.  
  19. await axios.get(`/SomePage/GetUsers/`,user).then(response=>{
  20. // do something here
  21. }.catch(error=>{console.log(error);});
  22. }
Add Comment
Please, Sign In to add comment