Prepend

Prepend is used to add a single element to the beginning of a sequence.


If you want to prepend a product to the beginning of the list:

var products = new List<string> { "Product1", "Product2", "Product3" };
var newProduct = "Product0";


var updatedProducts = products.Prepend(newProduct);


foreach (var product in updatedProducts)
{
    Console.WriteLine(product);
}