Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# linq unique by property

List<Person> distinctPeople = allPeople
   .GroupBy(p => p.PersonId)
   .Select(g => g.FirstOrDefault())
   .ToList();
Comment

c# linq unique by property

Persons.ToLookup(p => p.Id).Select(coll => coll.First());
Comment

PREVIOUS NEXT
Code Example
Csharp :: unity number generator 
Csharp :: unity c# script for movement left and right 
Csharp :: How to add a dynamically created form to a new tab in Syncfusion WinForms TabControlAdv? 
Csharp :: simplified if statement c# 
Csharp :: C# pull appart property chain in expression 
Csharp :: .net disable show exception 
Csharp :: how to make a 2d character move in unity 2020 
Csharp :: unity convert pixels to units 
Csharp :: sterge element din coada c# 
Csharp :: c# interoperability with linux or bash script 
Csharp :: Jeng InitDb 
Csharp :: how to store more precise data then float c# 
Csharp :: c# Color Convert 
Csharp :: EntityFramework: using tables in different scemas 
Csharp :: c# Detect Cycle in a Directed Graph 
Csharp :: custom convert list object to other object c# 
Csharp :: c# summary angle brackets 
Csharp :: nunjucks if variable exists 
Csharp :: keep sprites at fixed transform according to screen resolution unity 
Csharp :: jsonconvert serializeobject and jsonconvert deserialize to list 
Csharp :: get higest number in MVC 
Csharp :: binary search tree c# stackoverflow 
Csharp :: c# sort word 
Csharp :: c# run foreach loop x times 
Csharp :: asp.net mvc table array binding arbitrary indices 
Csharp :: how to count specific controls in a container c# 
Csharp :: assign a list to another in c# without a loop 
Csharp :: c# execute run control panel 
Csharp :: c# check word length 
Csharp :: get first and last item list c# 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =