Hi
In below code i want only Distinct Participant Id
public List
{
try
{
List
where t.TrainingID == ID
select t).ToList();
return Result;
}
catch (Exception ex)
{
throw ex;
}
}
Thanks
Jignesh KumarPosted Sep 8, 2022, 6:16 AM
Vishal YelvePosted Sep 8, 2022, 6:29 AM
Ramco RamcoPosted Sep 8, 2022, 6:11 AM
Hi Jignesh
It is giving error Iqueryable TrainingParticipant does not contain a definition for distinctBy
Trying below code but not working
public List GetSelectedUsers(Int32 ID) Result = (from t in context.TrainingParticipants
{
try
{
List
where t.TrainingID == ID
orderby t.ParticipantID select t.ParticipantID).Distinct().ToList();
//select t).Distinct(x => x.ParticipantID).ToList();
return Result;
}
catch (Exception ex)
{
throw ex;
}
}
Thanks
Rajanikant HawaldarPosted Sep 8, 2022, 6:10 AM
Jignesh KumarPosted Sep 8, 2022, 6:09 AM