更新模型多个记录.net核心2

时间:2017-12-26 16:25:00

标签: asp.net-core-2.0

获取无回发结果。 See Screen Shot details

    [HttpPost]
    //[ValidateAntiForgeryToken]
    public async Task<IActionResult> EditList(IEnumerable<EmployeeModel> employeeModels)
    {
            foreach (EmployeeModel emp in employeeModels)
            {
                _context.Update(emp);
                await _context.SaveChangesAsync();
            }
            return RedirectToAction(nameof(Index));

    }

0 个答案:

没有答案