示例#1
0
 public void Add(TEntity item)
 {
     lock (root)
     {
         list.Add(item);
     }
 }
示例#2
0
        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());
        }