using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Syslab.Samples.Ex01
{
    class Program
    {
        static void Main(string[] args)
        {
            List<Person> persons = new List<Person>(new Person[] 
                {
                    new Person() {  Name = "José",Age = 54},
                    new Person() {  Name = "Maria",Age = 65},
                    new Person() {  Name = "Aparecida",Age = 46}
                });

            var result = from p in persons
                         where p.Age > 50
                         select p;

            foreach (var item in result)
                Console.WriteLine(string.Format("Name = {0}, Age = {1}", item.Name, item.Age));
        }
    }

    class Person
    {
        public string Name
        {
            get;
            set;
        }

        public int Age
        {
            get;
            set;
        }
    }
}
