Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

how to use distinct in linq query in c#

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

linq distinct

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

PREVIOUS NEXT
Code Example
Csharp :: how to get parent gameobject in unity 
Csharp :: convert string to int and read it 
Csharp :: asp net c# compare date to current 
Csharp :: dictionary c# iterate 
Csharp :: enum element count C# 
Csharp :: default generic parameter for method in c# 
Csharp :: unity movement 
Csharp :: c# create object with properties 
Csharp :: how to say hello world in c# 
Csharp :: c# check if string is all numbers 
Csharp :: polybius square 
Csharp :: c# return switch 
Csharp :: how to do time.deltatime in c# 
Csharp :: c# list tuple 
Csharp :: c# list remove item based on property duplicate 
Csharp :: c# web api return image file 
Csharp :: serilog minimum log level 
Csharp :: defaultrequestheaders.authorization basic auth 
Csharp :: function in c# to do addition 
Csharp :: string to biginteger c# 
Csharp :: c# unity 
Csharp :: make http request c# 
Csharp :: can you have multiple statement in a case c# 
Csharp :: unity joystick movement 
Csharp :: unity action example 
Csharp :: update squence c# 
Csharp :: route attribute controller with parameter asp.net core 
Csharp :: roman 
Csharp :: null coalescing operator c# 
Csharp :: c# and in if statement 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =