コード例 #1
0
 public EmployeeModel Add(EmployeeModel employee)
 {
     employee.Id = _employeeList.Max(e => e.Id) + 1;
     _employeeList.Add(employee);
     return(employee);
 }
コード例 #2
0
 public EmployeeModel Add(EmployeeModel employee)
 {
     context.Employees.Add(employee);
     context.SaveChanges();
     return(employee);
 }