LINQ & partial

lolol lol·2025년 4월 10일
    public class TestForLinq
    {
        private readonly int[] numbers = [ 0, 1, 2, 3, 4, 5, 6 ];
        private IEnumerable<int> test_numbers;

        public TestForLinq()
        {
            test_numbers = from _ in numbers
                          where (_ % 2 == 0)
                          select _;
        }

        public void Test() => test_numbers.ToList().ForEach(num => Console.WriteLine(num));
    }

///
0
2
4
6

//
profile
정가거부

0개의 댓글