LINQ Empty MethodIn LINQ, the Empty method or operator is used to return the empty sequence of the collection. Syntax of LINQ Empty MethodHere is the syntax of the LINQ Empty method to generate the collection with an empty sequence. In the above syntax, we defined the Empty() method to generate an empty sequence. Example of LINQ Empty MethodHere is the example of the LINQ Empty Method to generate the collection, which contains the empty sequence. In the above example, we defined the Empty method to generate an empty sequence. If we run the above example, we will get empty results. This is the way how we can use the LINQ Empty() method to generate the empty sequence of the collection. Output:
Next TopicLINQ to Objects
|