public static void Add(Employee employee) { var context = new SoftUniEntities(); context.Employees.Add(employee); context.SaveChanges(); }
public static void Delete(Employee employee) { var context = new SoftUniEntities(); var getId = context.Employees.Find(employee.EmployeeID); context.Employees.Remove(getId); context.SaveChanges(); }
public static void Modify(Employee employee, string newName) { var context = new SoftUniEntities(); var getId = context.Employees.Find(employee.EmployeeID); getId.FirstName = newName; context.SaveChanges(); }