Exemple #1
0
        /// <summary>
        /// Convert entities to a concrete type
        /// </summary>
        /// <typeparam name="C">Concrete type</typeparam>
        /// <returns></returns>
        public virtual BaseEntityCollection <C> To <C>() where C : BaseEntity
        {
            var coll = new BaseEntityCollection <C>();

            foreach (var entity in this)
            {
                coll.Add(entity as C);
            }

            return(coll);
        }
Exemple #2
0
        /// <summary>
        /// Clone collection
        /// </summary>
        /// <returns>A cloned collection</returns>
        public virtual BaseEntityCollection <T> Clone()
        {
            var clone = new BaseEntityCollection <T>();

            clone.CollectionEntityFlatten = CollectionEntityFlatten;

            foreach (var entity in this)
            {
                clone.Add((T)entity.Clone());
            }

            return(clone);
        }