示例#1
0
        internal void SearchBySponsor(string name)
        {
            if (PlanList == null)
            {
                PlanList = planBusiness.Read();
            }
            if (PlansDictionary == null)
            {
                PlansSponsorDictionary = PlanList.ToDictionary(p => p.Sponsor.Name, p => p);
            }
            var results = PlansSponsorDictionary.Where(plan => plan.Key.Contains(name)).Select(plan => plan.Value);

            foreach (var item in results)
            {
                Console.WriteLine(item.ToString());
            }
        }