Last active
February 17, 2018 22:17
-
-
Save eqr/b45bb6a70e4d6401cbc82d504e2e8f8b to your computer and use it in GitHub Desktop.
Gird.NET example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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