Guest User

Untitled

a guest
Aug 14th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. public async Task<IActionResult> Create()
  2. {
  3. await ConfigureSelectedList();
  4. return View();
  5. }
  6.  
  7. function btnSaveAddEmployee() {
  8. $.post('/Accounts/_AddEmployee', **как то отправить модель из ModalView**);
  9. }
  10.  
  11. [HttpPost]
  12. public async Task<IActionResult> _AddEmployee(Employee employee)
  13. {
  14. var result = new Employee
  15. {
  16. FirstName = employee.FirstName
  17. };
  18. await _db.Employees.AddAsync(result);
  19. await _db.SaveChangesAsync();
  20. return Ok(result);
  21. }
Add Comment
Please, Sign In to add comment