Ejemplo n.º 1
0
        /// <summary>
        /// Add a Feed to the Food
        /// If it is not already present in this food then add it
        /// If it is already present then add it to the existing feed.
        /// </summary>
        /// <param name="NewFeed">The new feed to add to the food</param>
        public void AddFeed(Feed NewFeed)
        {
            NewFeed.FeedName = CleanUpFeedName(NewFeed.FeedName);
            bool alreadyInFood = IsThisFeedInFood(NewFeed.FeedName);

            if (alreadyInFood == false)
            {
                feeds.Add(NewFeed);
            }
            else
            {
                Feed existing = GetFeed(NewFeed.FeedName);
                existing.AddToExisting(NewFeed);
            }
        }