// ===++===
//
// OrtizOL
//
// ===--===
/*============================================================
//
// Clase: UsoFrom.cs
//
// Propósito: Demostración de la clausula from.
//
============================================================*/
using System;
using System.Collections.Generic;
using System.Linq;
namespace Recetas.Cap02
{
internal class UsoFrom
{
public static void Main()
{
// Arreglo de enteros como fuente de datos:
int[] numeros = {5, 4, 1, 3, 9, 8, 6, 7, 2, 0};
// Creación de la consulta:
IEnumerable<int> numerosMenores5 = from numero in numeros where numero < 5 select numero;
// Iteramos la colección
foreach (int numero in numerosMenores5)
{
Console.Write( "{0} ", numero);
}
Console.WriteLine();
}
}
}
Ly8gPT09Kys9PT0KLy8KLy8JT3J0aXpPTAovLwovLyA9PT0tLT09PQovKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQovLwovLyBDbGFzZTogVXNvRnJvbS5jcwovLwovLyBQcm9ww7NzaXRvOiBEZW1vc3RyYWNpw7NuIGRlIGxhIGNsYXVzdWxhIGZyb20uCi8vCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCgp1c2luZyBTeXN0ZW07CnVzaW5nIFN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljOwp1c2luZyBTeXN0ZW0uTGlucTsKCm5hbWVzcGFjZSBSZWNldGFzLkNhcDAyCnsKCWludGVybmFsIGNsYXNzIFVzb0Zyb20KCXsKCQlwdWJsaWMgc3RhdGljIHZvaWQgTWFpbigpCgkJewoJCQkvLyBBcnJlZ2xvIGRlIGVudGVyb3MgY29tbyBmdWVudGUgZGUgZGF0b3M6CgkJCWludFtdIG51bWVyb3MgPSB7NSwgNCwgMSwgMywgOSwgOCwgNiwgNywgMiwgMH07CgkJCQoJCQkvLyBDcmVhY2nDs24gZGUgbGEgY29uc3VsdGE6CgkJCUlFbnVtZXJhYmxlPGludD4gbnVtZXJvc01lbm9yZXM1ID0gZnJvbSBudW1lcm8gaW4gbnVtZXJvcyB3aGVyZSBudW1lcm8gPCA1IHNlbGVjdCBudW1lcm87CgkJCQoJCQkvLyBJdGVyYW1vcyBsYSBjb2xlY2Npw7NuCgkJCWZvcmVhY2ggKGludCBudW1lcm8gaW4gbnVtZXJvc01lbm9yZXM1KQoJCQl7CgkJCQlDb25zb2xlLldyaXRlKCAiezB9ICIsIG51bWVybyk7CgkJCX0KCQkJCgkJCUNvbnNvbGUuV3JpdGVMaW5lKCk7CgkJfQoJfQp9