Ejemplo n.º 1
0
        private static void relations()
        {
            List <Contact> contacts = Contact.Lister();
            List <Adresse> adresses = Adresse.Lister();

            var resultat = from c in contacts
                           join a in adresses on c.Email equals a.Mail
                           where a.Ville == "paris"
                           orderby c.Nom
                           select new { c.Nom, c.Prenom, a.Ville };

            foreach (var item in resultat)
            {
                Console.WriteLine(item.Nom + " " + item.Ville);
            }
        }