Exemplo n.º 1
0
        /// <summary>
        /// Find an immediate sub-category of the given Name.
        /// </summary>
        /// <param name="Name"></param>
        /// <returns></returns>
        public Category FindChild(string Name)
        {
            Category category = children.SingleOrDefault(i => i.Name == Name);
            if (category == null)
            {
                category = new Category() { Name = Name };
                children.Add(category);
            }

            return category;
        }