private static void DeleteEmployeeSlow(int empId) { var context = new SoftUniEntities(); var emp = context.Employees.Find(empId); context.Employees.Remove(emp); context.SaveChanges(); }
private static int CreateSampleEmployee() { var emp = new Employee() { FirstName = "First", MiddleName = "M.", LastName = "Last", AddressID = 1, DepartmentID = 1, HireDate = DateTime.Now, JobTitle = "Freelancer", Salary = 25000 }; var context = new SoftUniEntities(); context.Employees.Add(emp); context.SaveChanges(); return emp.EmployeeID; }