예제 #1
0
        public void UpdateEmployee(Employee employee)
        {
            Employee e = context.Employees.Find(employee.Id);

            if (e != null)
            {
                context.Entry(e).State = EntityState.Modified;
                context.SaveChanges();
            }
        }
예제 #2
0
        public long InsertEmployee(Employee employee)
        {
            context.Employees.Add(employee);
            context.SaveChanges();

            return employee.Id;
        }