Top "Generic-list" questions

language-agnostic tag for a collection of items where each item has a certain position

Randomize a List<T>

What is the best way to randomize the order of a generic list in C#? I've got a finite set …

c# generic-list
Remove duplicates in the list using linq

I have a class Items with properties (Id, Name, Code, Price). The List of Items is populated with duplicated items. …

c# linq linq-to-objects generic-list
How can I easily convert DataReader to List<T>?

I have data in a DataReader which I want to be converted to a List<T>. What is …

c# datareader generic-list
How to add item to the beginning of List<T>?

I want to add a "Select One" option to a drop down list bound to a List<T>. …

c# drop-down-menu generic-list
c# foreach (property in object)... Is there a simple way of doing this?

I have a class containing several properties (all are strings if it makes any difference). I also have a list, …

c# properties foreach generic-list
Best way to update an element in a generic List

Suppose we have a class called Dog with two strings "Name" and "Id". Now suppose we have a list with 4 …

c# generic-list
Fastest way to Remove Duplicate Value from a list<> by lambda

what is fastest way to remove duplicate values from a list. Assume List<long> longs = new List<…

c# list c#-4.0 lambda generic-list
C# generic list <T> how to get the type of T?

I'm working on a reflection project, and now I'm stuck. If I have an object of myclass that can hold …

c# reflection generic-list
Editing an item in a list<T>

How do I edit an item in the list in the code below: List<Class1> list = new List&…

c# .net generic-list
Convert an enum to List<string>

How do I convert the following Enum to a List of strings? [Flags] public enum DataSourceTypes { None = 0, Grid = 1, ExcelFile = 2, ODBC = 4 }; …

c# .net enums generic-list