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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.