示例#1
0
        public void FoxGreenAndPallida(List <Fox> input)
        {
            var greenPallida = from fox in input
                               where fox.Color == "green" && fox.Type == "pallida"
                               select fox.Name;

            foreach (var Fox in greenPallida)
            {
                Console.WriteLine("The fox named {0} is green and pallida.", Fox.ToString());
            }
        }
示例#2
0
        public void FindGreenFoxes(List <Fox> input)
        {
            var greenFox = from greenfox in input
                           where greenfox.Color == "green"
                           select greenfox.Name;

            foreach (var Fox in greenFox)
            {
                Console.WriteLine("The fox named {0} is green.", Fox.ToString());
            }
        }