コード例 #1
0
        /// <summary>
        /// Returns a dictionary of all sites from a particular campground, with the key being the site ID and the value being the site class object.
        /// </summary>
        /// <param name="campground">A campground from which the sites will be returned</param>
        /// <returns>A dictionary of all sites from a particular campground, with the key being the site ID and the value being the site class object</returns>
        public Dictionary <int, Site> GetSiteDictionary(Campground campground)
        {
            List <Site>            list           = _db.GetAllSites(campground.CampgroundID);
            Dictionary <int, Site> SiteDictionary = new Dictionary <int, Site>();

            foreach (Site item in list)
            {
                SiteDictionary.Add(item.SiteID, item);
            }
            return(SiteDictionary);
        }