c# get unique items from list code example
Example 1: c# linq select only unique values from list
var uniqueCategories = repository.GetAllProducts()
.Select(p=>p.Category)
.Distinct();
Example 2: get unique array based on value in c#
items.Distinct<int>()