I have a class as under
class WarningClass
    {
        public string SqlEyeWarning { get; set; }
        public string FileName { get; set; }
    }
It is populated as under
List<WarningClass> lstWarningClass1 = new List<WarningClass>();
lstWarningClass1.Add(new WarningClass { FileName = "a.sql", SqlEyeWarning = "SD001: order mismatch or it should be ON." });
lstWarningClass1.Add(new WarningClass { FileName = "a.sql", SqlEyeWarning = "SD001: order mismatch or it should be ON." });
lstWarningClass1.Add(new WarningClass { FileName = "c.sql", SqlEyeWarning = "SD009: Missing or order mismatch of Grant statement." });
As can be make out that there is a duplicate entry for the first and second record.
How to get unique entries.
Final output
FileName = "a.sql", SqlEyeWarning = "SD001: order mismatch or it should be ON." 
FileName = "c.sql", SqlEyeWarning = "SD009: Missing or order mismatch of Grant statement."
If I do lstWarningClass1.Distinct(), that does not work
 
     
     
    