CSharp examples for Custom Type:Lambda
An delegate instantiated with a lambda
using System;/*from w w w .ja va 2 s .c o m*/ using System.Collections.Generic; delegate int AgeIsNothing(int n); class Program { static void Main(string[] args) { List<int> numbers = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 }; int[] numArray = numbers.ToArray(); List<string> words = new List<string> { "one", "two", "three", "four", "five" }; AgeIsNothing ain = new AgeIsNothing(n => { return n - n; }); int negligibleAge = ain(15); Console.WriteLine("\tFor 15, the nothing age is {0}", negligibleAge); } }