If your requirements are to have no duplicates, you should be using a HashSet. HashSet.Add will return false when the item already exists (if that even matters to you).
var uniq = allvalues.GroupBy(x => x.Id).Select(y=>y.First()).Distinct();
var uniqueCategories = repository.GetAllProducts() .Select(p=>p.Category) .Distinct();
var uniqueItemsList = yourList.Distinct().ToList();