public static void Add(Employee emp) { using (var context = new SoftUniEntities()) { context.Employees.Add(emp); context.SaveChanges(); } }
public static void Delete(Employee emp) { using (var context = new SoftUniEntities()) { context.Employees.Attach(emp); context.Employees.Remove(emp); context.SaveChanges(); } }