Using Single : Single « LINQ « C# / CSharp Tutorial






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

public class MainClass{
   public static void Main(){
            int[] numbers = {1, 2, 3, 4, 5, 6, 7, 8, 9};
            var query = numbers.Single(n => n > 8);
            Console.Write(query);
   }
}








22.66.Single
22.66.1.Using Single
22.66.2.Single with object list
22.66.3.Single with condition