public void Add(TEntity item) { lock (root) { list.Add(item); } }
public TEntity[] FindAll(Func <TEntity, bool> match) { if (match == null) { throw new ArgumentNullException("match", "Match item predicate can not be null."); } var list = new OptimizedList <TEntity>(); var item = default(TEntity); for (int i = 0; i < Count; i++) { item = itemsSource[i]; if (match(item)) { list.Add(item); } } return(list.ToArray()); }