Skip to content

Instantly share code, notes, and snippets.

@eqr
Last active February 17, 2018 22:17
Show Gist options
  • Save eqr/b45bb6a70e4d6401cbc82d504e2e8f8b to your computer and use it in GitHub Desktop.
Save eqr/b45bb6a70e4d6401cbc82d504e2e8f8b to your computer and use it in GitHub Desktop.
Gird.NET example
List<Person> persons = GetAllPersons();
var cache = CacheFactory.CreateCache(persons);
cache.AddIndexer(new Indexer<Person, string>(p => p.Name));
// Returns all persons with name Jane
var janes = cache.Get(p => p.Name, "Jane").ToList();
cache.AddIndexer(new Indexer<Person, string>(p => p.LastName));
// Returns all persons with last name Smith
var smiths = cache.Get(p => p.LastName, "Smith").ToList();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment