.


:




:

































 

 

 

 


Using System; using System.Linq;




class SimpQuery {

static void Main() {

int[] nums = {.1, -2, 3, 0, -4, 5 };

// , var posNums = from n in nums where n > 0 select n;

Console.Write(" nums: ");

// , foreach(int i in posNums) Console.Write(i + " ");

Console.WriteLine();

}

}

.

nums: 1 3 5

, , nums. , LINQ. .

.

LINQ System.Linq.

nums int. C# IEnumerable<T>. C# , LINQ.

, nums .

var posNums = from n in nums where n > 0 select posNums . , . var posNums . , posNums . , ( IEnumerable<T>). posNums .

from, . , . . ( nums). . int. from.

from _ in _

where, , , . where.

where _

_ bool. . where. where.

where n >

, . > 0 . , . , where , .

select group. select, , . , , . , , where. ,

. , . , select , . .

, posNums , . , , . , , , . posNums , .





:


: 2016-12-03; !; : 388 |


:

:

, .
==> ...

1501 - | 1263 -


© 2015-2024 lektsii.org - -

: 0.023 .