Exemplo n.º 1
0
        public static void Add(Employee employee)
        {
            var context = new SoftUniEntities();

            context.Employees.Add(employee);
            context.SaveChanges();
        }
Exemplo n.º 2
0
        public static void Delete(Employee employee)
        {
            var context = new SoftUniEntities();
            var getId   = context.Employees.Find(employee.EmployeeID);

            context.Employees.Remove(getId);
            context.SaveChanges();
        }
Exemplo n.º 3
0
        public static void Modify(Employee employee, string newName)
        {
            var context = new SoftUniEntities();
            var getId   = context.Employees.Find(employee.EmployeeID);

            getId.FirstName = newName;
            context.SaveChanges();
        }