I have an IEnumerable that returns a list of Processes and details from an SQL stored procedure.
I'm trying to get a list of Distinct values of ProcessQuestions from ProcessList.
I've tried the following code but it always lists everything from ProcessList including duplicate ProcessQuestions.
ProcessListDistinct = ProcessList.Select(p => new ProcessListSummary
{
ProcessQuestions = p.ProcessQuestions,
ProcessQuestionsID = pProcessQuestionsID
}).Distinct().ToList();
How do I only show distinct values of ProcessQuestions please.
Many thanks