Example #1
0
        /// <summary>
        /// Check to see if there are any related Customers, and load them if requested
        /// </summary>
        public static void CheckExpandCustomers(SqlDataManager sdm, IEnumerable <TelegraphStation> telegraphStations, string expandString)
        {
            var telegraphStationsWhere = CreateTelegraphStationWhere(telegraphStations);

            expandString = expandString.SafeToString();

            if (String.Equals(expandString, "all", StringComparison.OrdinalIgnoreCase) || expandString.IndexOf("customers", StringComparison.OrdinalIgnoreCase) >= 0)
            {
                var childCustomers = sdm.GetAllCustomers <Customer>(telegraphStationsWhere);

                telegraphStations.ToList()
                .ForEach(feTelegraphStation => feTelegraphStation.LoadCustomers(childCustomers));
            }
        }