In-Memory Data

One of the most prominent sources of data is the computer’s own memory, though it’s often overlooked as a true data source. In-memory collections are containers for series of objects to which you might want to apply certain operations. For the sake of discussion, let’s consider an in-memory list of products stored as .NET objects in a generic list collection:

var products = new List<Product> {    new Product { Name = "Chai", Price = 18.00m },    new Product { Name = "Chang", Price = 19.00m },    new Product { Name = "Aniseed Syrup", Price = 10.00m },    new Product { Name = "Chef Anton's Cajun Seasoning", Price = 22.00m },    new Product { Name = "Chef Anton's Gumbo Mix", Price = 21.35m },    new Product ...

Get C# 5.0 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.