public EmployeesModelService(IEmployeesRepository employeesRepository) { _employessRepository = employeesRepository; _employess.OnItemAdd += item => EmployeeAdded?.Invoke(this, new EmployeeModelCollectionChangedEventArgs(item)); _employess.OnItemRemove += item => EmployeeRemoved?.Invoke(this, new EmployeeModelCollectionChangedEventArgs(item)); Employees = new ReadOnlyCollection <EmployeeModel>(_employess); }
public void RemoveEmployee(Entity e) { if (employees.Remove((int)e.ID)) { if (EmployeeRemoved != null) { EmployeeRemoved.Invoke(this, e); } } }