Created
April 22, 2012 03:49
-
-
Save afifmohammed/2448267 to your computer and use it in GitHub Desktop.
new querite api
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
public class FileSystem | |
{ | |
public void Evaluate(IFolder folder) | |
{ | |
int? count; | |
TimeSpan? howLong; | |
var firstTen = Query(folder) | |
.Statistics(x => count = x.Count) | |
.Statistics(x => howLong = x.ExecutionSpan) | |
.Customize(x => x.AsOf(15.MinutesFromNow())) | |
.Customize(x => x.CachedFor(10.Minutes())) | |
.Execute(new LongNameFiles { Skip = 0, Take = 10, Length = 15 }); | |
} | |
/// <remarks>should use ioc, method only shown to demonstrate the point</remarks> | |
private IQuery<TSource> Query<TSource>(TSource source) | |
{ | |
return new CacheableQuery<TSource>( | |
actualQuery: new Query<TSource>(source), | |
cacheStoreFactory: new InMemoryCacheFactory()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment