c# distinct comparer multiple properties
C#
List<Person> distinctPeople = allPeople
.GroupBy(p => new {p.PersonId, p.FavoriteColor} )
.Select(g => g.First())
.ToList();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;
}
}
}
Also in C#:
- Title
- c# inline if
- Category
- C#
- Title
- how to use K2 games Games parallax background
- Category
- C#
- Title
- c sharp index of substring
- Category
- C#
- Title
- generate a dropdown list from array data using razor .net mvc
- Category
- C#
- Title
- what does thismean incsharp public static void Main
- Category
- C#
- Title
- how to get the last element in an array in c#
- Category
- C#
- Title
- panel drag all form c#
- Category
- C#
- Title
- C# string is all zeros
- Category
- C#
- Title
- wpf label text in center
- Category
- C#
- Title
- IEnumerator
- Category
- C#
- Title
- sort datatable c#
- Category
- C#
- Title
- how to remove vowels from a sttring using regex c#
- Category
- C#
- Title
- C# Unknown column 'FundAllocation' in 'field list
- Category
- C#
- Title
- bubble sort c#
- Category
- C#
- Title
- unity how to make a ui disappear
- Category
- C#
- Title
- traversing an enum c#
- Category
- C#
- Title
- linq c# where condition
- Category
- C#
- Title
- C# save pdf stream to file
- Category
- C#
- Title
- create expression func c# for use in where clause
- Category
- C#
- Title
- override Microsoft.AspNetCore.Authorization.AuthorizeAttribute
- Category
- C#
- Title
- c# generate random number
- Category
- C#
- Title
- public enum c#
- Category
- C#
- Title
- what function is called just before the a script is ended c#
- Category
- C#
- Title
- unity how to move an object to another object
- Category
- C#
- Title
- c# nullable generic
- Category
- C#
- Title
- unity rigidbody constraints
- Category
- C#
- Title
- how to stop player rotating when hit by object
- Category
- C#
- Title
- replace all ponctuation characters c#
- Category
- C#
- Title
- c# httpclient azure function authorization
- Category
- C#
- Title
- change textbox location C#
- Category
- C#
- Title
- while loop in c#
- Category
- C#
- Title
- unity load scene
- Category
- C#
- Title
- call a function c#
- Category
- C#
- Title
- linq query select top 1 c#
- Category
- C#
- Title
- c# string array
- Category
- C#
- Title
- unity list
- Category
- C#
- Title
- c# creating exceptions
- Category
- C#
- Title
- console application in c# ms crm
- Category
- C#
- Title
- how to move towards an object unity
- Category
- C#
- Title
- c# authorize attribute
- Category
- C#
- Title
- c# check to see if dictionary key exists
- Category
- C#
- Title
- unity load text resources from subfolder
- Category
- C#
- Title
- isprime c#
- Category
- C#
- Title
- how to make if statement c#
- Category
- C#
- Title
- c# mixed multidimensional array
- Category
- C#
- Title
- Unity if object doens't exist
- Category
- C#
- Title
- mvc write to console
- Category
- C#
- Title
- validating file upload asp.net core mvc
- Category
- C#
- Title
- c# shorten an method
- Category
- C#
- Title
- how to insert into a list c#
- Category
- C#
- Title
- in unity i want to destroy a gameobject when it hits the edge of the screen
- Category
- C#
- Title
- unity string format time
- Category
- C#
- Title
- unity randomly generated numbers c#
- Category
- C#
- Title
- newtonsoft create dynamic object
- Category
- C#
- Title
- sum the digits in c#
- Category
- C#
- Title
- C# .net core convert string to enum
- Category
- C#
- Title
- eventos c#
- Category
- C#
- Title
- unity remove gameobject
- Category
- C#
- Title
- variables
- Category
- C#
- Title
- c# format string to date yyyymmdd
- Category
- C#
- Title
- find negative version of integer in c#
- Category
- C#
- Title
- use newtonsoft json to clone object
- Category
- C#
- Title
- how to make rb.addforce 2d
- Category
- C#
- Title
- How can you learn C# on your own
- Category
- C#
- Title
- C# invoke
- Category
- C#
- Title
- c# multiline comment
- Category
- C#
- Title
- C# assigning image location
- Category
- C#
- Title
- unity image
- Category
- C#
- Title
- never lose focus textbox c#
- Category
- C#
- Title
- exception handling c#
- Category
- C#
- Title
- unity get all by tag
- Category
- C#
- Title
- unity if gameobject exists
- Category
- C#
- Title
- isdaylightsavingtime in c#
- Category
- C#
- Title
- wpf datatrigger enum binding
- Category
- C#
- Title
- unity how to change text in script
- Category
- C#
- Title
- viewBag as a list
- Category
- C#
- Title
- unity rotate object relative to camera
- Category
- C#
- Title
- c# switct case
- Category
- C#
- Title
- unity 2d enemy field of view
- Category
- C#
- Title
- hot to move pobject unity
- Category
- C#
- Title
- exception handling c# stack overflow
- Category
- C#
- Title
- move character unity
- Category
- C#
- Title
- c# create array of int
- Category
- C#
- Title
- Exception thrown: 'System.FormatException' in mscorlib.dll dates
- Category
- C#
- Title
- zoom gedit
- Category
- C#
- Title
- asp net identity include phone number when registering
- Category
- C#
- Title
- .net core session
- Category
- C#
- Title
- c# fold list
- Category
- C#
- Title
- c# pull request
- Category
- C#
- Title
- add spaces between words unity
- Category
- C#
- Title
- how to pass object as test case in nunit c#
- Category
- C#
- Title
- how do loops on C#
- Category
- C#
- Title
- get enum by index c#
- Category
- C#
- Title
- unity face direction of movement
- Category
- C#
- Title
- .net directorysearcher get manager accountname
- Category
- C#
- Title
- set object to random color unity
- Category
- C#
- Title
- how to make a string a list of characters c#
- Category
- C#
- Title
- unity clamp rotation
- Category
- C#
- Title
- compile in one single exe c#
- Category
- C#
- Title
- debug.log
- Category
- C#