コード例 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("EmployeeId,FirstName,LastName,CreatedOn,UpdatedOn, NewDependentFirstName, NewDependentLastName")] EmployeeEditViewModel employee)
        {
            if (id != employee.EmployeeId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    await _repository.EditEmployee(employee);
                }
                catch (DbUpdateConcurrencyException)
                {
                    // error handling code would go here but I am skipping that for berevity of this project.
                }
            }

            ModelState.Clear();

            return(View(employee));
        }