Projection Operators: do calculation in select statement : Projection « LINQ « C# / CSharp Tutorial






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

public class MainClass {
    public static void Main() {
        int[] numbers = { 5, 4, 1, 3, 9};
        var numsPlusOne =
            from n in numbers
            select n + 1;

        Console.WriteLine("Numbers + 1:");
        foreach (var i in numsPlusOne) {
            Console.WriteLine(i);
        }
    }
}








22.57.Projection
22.57.1.Projection Operators: do calculation in select statement
22.57.2.Projection Linq
22.57.3.Projection Creates New Objects