C# program to demonstrate the example of SelectMany() method in Linq
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
total answers (1)
Program:
The source code to demonstrate the SelectMany() method of Linq is given below. The given program is compiled and executed successfully on Microsoft Visual Studio.
Output:
Explanation:
In the above program, we created an Employee that contains three data members ID, Name, and Skills. Here we created two static methods GetEmpDetails() and Main().
In the GetEmpDetails() method, we created multiple objects of Employee class with a list of employees and return them.
Using the above code we find the skills of all employees and then converted them into collection List.
In the above code, we printed the all skills of all employees on the console screen.