Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public async Task<IActionResult> Create()
- {
- await ConfigureSelectedList();
- return View();
- }
- function btnSaveAddEmployee() {
- $.post('/Accounts/_AddEmployee', **как то отправить модель из ModalView**);
- }
- [HttpPost]
- public async Task<IActionResult> _AddEmployee(Employee employee)
- {
- var result = new Employee
- {
- FirstName = employee.FirstName
- };
- await _db.Employees.AddAsync(result);
- await _db.SaveChangesAsync();
- return Ok(result);
- }
Add Comment
Please, Sign In to add comment