How to get distinct records using LINQ ?

Distinct records can be obtained using Distinct() method. Please refer below code for more details :

Problem : Get Unique or Distinct First Name from Employee table
Solution :
var employeeDistinct= (from emp in Employee

                                    select emp.FirstName).Distinct();

No comments:

Popular Posts