C# LINQ Wybierz tylko unikalne wartości z listy
var uniq = allvalues.GroupBy(x => x.Id).Select(y=>y.First()).Distinct();
woodman
var uniq = allvalues.GroupBy(x => x.Id).Select(y=>y.First()).Distinct();
var distValues = objList.Select(o=>o.typeId).Distinct().ToList();
var uniqueCategories = repository.GetAllProducts()
.Select(p=>p.Category)
.Distinct();
SELECT DISTINCT Column_name FROM table_name;
var uniquePeople = from p in people
group p by new {p.ID} //or group by new {p.ID, p.Name, p.Whatever}
into mygroup
select mygroup.FirstOrDefault();
var _dbLogList = (from d in _context.pu_Synchronize_Log
join cd in _context.pu_Synchronize_Child_Log
on d.Synchronize_Log_Id equals cd.Synchronize_Log_Id
where cd.Mobile_Device_Id == preference.DId && cd.Synchronize_Status == "OPEN"
&& !d.Is_Deleted && !cd.Is_Deleted
select new
{
d.Service_Name,
}).Distinct().ToList();