Exemplo n.º 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();
            }
        }
Exemplo n.º 2
0
        public long InsertEmployee(Employee employee)
        {
            context.Employees.Add(employee);
            context.SaveChanges();

            return employee.Id;
        }