예제 #1
0
        /// <summary>
        /// Find Entity
        /// </summary>
        /// <param name="entityFinder"></param>
        /// <returns></returns>
        public EntityListReadOnly <T> FindEntities(EntityFinder entityFinder)
        {
            EntityListReadOnly <T> returnValue = new EntityListReadOnly <T>();

            this.FindAll(returnValue, entityFinder, PredicateForEntityFinder);
            return(returnValue);
        }
예제 #2
0
        /// <summary>
        /// Clone an entity list by creating a new entity list, and cloning all list members.
        /// </summary>
        public virtual object Clone()
        {
            EntityListReadOnly <T> newEntityList = new EntityListReadOnly <T>();

            foreach (ICloneable entity in this)
            {
                newEntityList.Add((T)entity.Clone());
            }

            return(newEntityList);
        }
예제 #3
0
        /// <summary>
        /// Find Entity
        /// </summary>
        /// <param name="entityFinder"></param>
        /// <returns></returns>
        public T FindEntity(EntityFinder entityFinder)
        {
            T returnValue = null;
            EntityListReadOnly <T> entityListReadOnly = this.FindEntities(entityFinder);

            if (entityListReadOnly.Count > 0)
            {
                returnValue = entityListReadOnly[0];
            }
            return(returnValue);
        }