コード例 #1
0
        /// <summary>
        /// Check to see if there are any related AgencyContacts, and load them if requested
        /// </summary>
        public static void CheckExpandAgencyContacts(SqlDataManager sdm, IEnumerable <Agency> agencies, string expandString)
        {
            expandString = expandString.SafeToString();

            if (String.Equals(expandString, "all", StringComparison.OrdinalIgnoreCase) || expandString.IndexOf("agencyContacts", StringComparison.OrdinalIgnoreCase) >= 0)
            {
                var agenciesWhere       = CreateAgencyWhere(agencies, "Agency");
                var childAgencyContacts = sdm.GetAllAgencyContacts <AgencyContact>(agenciesWhere)
                                          .OrderBy(orderBy => orderBy.Name)
                ;

                agencies.ToList()
                .ForEach(feAgency => feAgency.LoadAgencyContacts(childAgencyContacts));
            }
        }