Linq Distinct

[Solved] Linq Distinct | Php Frameworks Codeigniter - Code Explorer | yomemimo.com
Question : C# .NET Core linq Distinct

Answered by : kevin-wilson

var distinctUsers = allUsers .GroupBy(x => x.UserId) .Select(x => x.First()) .ToList();

Source : | Last Update : Tue, 07 Jul 20

Question : how to use distinct in linq query in c#

Answered by : raksha-deshmukh

var distValues = objList.Select(o=>o.typeId).Distinct().ToList();

Source : | Last Update : Thu, 11 Feb 21

Question : select distinct

Answered by : courageous-cowfish-2tw1b4660v1n

SELECT DISTINCT ma_colonne
FROM nom_du_tableau

Source : https://sql.sh/cours/distinct | Last Update : Tue, 10 Mar 20

Question : c# distinct comparer multiple properties

Answered by : abuzar-gashtasebi

List<Person> distinctPeople = allPeople .GroupBy(p => new {p.PersonId, p.FavoriteColor} ) .Select(g => g.First()) .ToList();

Source : https://stackoverflow.com/questions/489258/linqs-distinct-on-a-particular-property | Last Update : Sun, 26 Apr 20

Question : query DISTINCT

Answered by : hungry-hamster

SELECT DISTINCT Column_name FROM table_name;

Source : | Last Update : Tue, 21 Apr 20

Question : linq distinct

Answered by : phipi

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();

Source : https://stackoverflow.com/questions/489258/linqs-distinct-on-a-particular-property | Last Update : Mon, 18 Jan 21

Question : select distinct linq mvc

Answered by : mr-robot

public static IQueryable<ProdType> GetDistinctProdType( this IQueryable<ProdInfo> query, int categoryId)
{ return (from p in query where p.CatID == categoryId select p.Type).Distinct();
}

Source : https://stackoverflow.com/questions/5144409/linq-distinct | Last Update : Thu, 12 Mar 20

Question : c# distinct comparer multiple properties

Answered by : abuzar-gashtasebi

public static IEnumerable<TSource> DistinctBy<TSource, TKey> (this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
{ HashSet<TKey> seenKeys = new HashSet<TKey>(); foreach (TSource element in source) { if (seenKeys.Add(keySelector(element))) { yield return element; } }
}

Source : https://stackoverflow.com/questions/489258/linqs-distinct-on-a-particular-property | Last Update : Sun, 26 Apr 20

Answers related to linq distinct

Code Explorer Popular Question For Php Frameworks Codeigniter