Пример #1
0
        public IEnumerable <object> GetOwnedChildren(bool bRecursive)
        {
            //return Reflection.GetOwnedChildren(this, bRecursive);

            var iepsa = this as IEntityPostSerializationActions;

            foreach (var itemsList in iepsa.GetOwnedChildrenLists())
            {
                if (itemsList != null)
                {
                    foreach (var item in itemsList)
                    {
                        yield return(item);

                        if (bRecursive)
                        {
                            IEntityBase entityBase = item as IEntityBase;
                            if (entityBase != null)
                            {
                                foreach (var childItem in entityBase.GetOwnedChildren(bRecursive))
                                {
                                    yield return(childItem);
                                }
                            }
                        }
                    }
                }
            }
        }