Skip to content

Commit

Permalink
Fixing the sample code (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
smurariu authored and alastairtree committed May 13, 2018
1 parent 7b21e74 commit 9862ffa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion LazyCache/LazyCache.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<projectUrl>https://github.com/alastairtree/LazyCache</projectUrl>
<iconUrl>https://raw.githubusercontent.com/alastairtree/LazyCache/master/artwork/logo-128.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Lazy cache is a simple,thread safe in-memory caching service</description>
<description>Lazy cache is a simple, thread safe in-memory caching service</description>
<releaseNotes>See https://raw.githubusercontent.com/alastairtree/LazyCache/master/ReleaseNotes.md</releaseNotes>
<copyright>Copyright 2014</copyright>
<summary>Lazy cache is a simple in-memory caching service for .net and c sharp. It has a developer friendly generics based API, and providing a thread safe cache implementation that guarantees to only execute your cachable delegates once (it's lazy!). Under the hood it leverages ObjectCache and Lazy to provide performance and reliability in heavy load scenarios. For more info see https://github.com/alastairtree/LazyCache </summary>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Func<ComplexObjects> complexObjectFactory = () => methodThatTakesTimeOrResources

// Get our ComplexObjects from the cache, or build them in the factory func
// and cache the results for next time under the given key
ComplexObject cachedResults = cache.GetOrAdd("uniqueKey", complexObjectFactory);
ComplexObjects cachedResults = cache.GetOrAdd("uniqueKey", complexObjectFactory);
```

As you can see the magic happens in the `GetOrAdd()` method which gives the consumer an atomic and tidy way to add caching to your code. It leverages a factory delegate `Func` and generics to make it easy to add cached method calls to your app.
Expand Down

0 comments on commit 9862ffa

Please sign in to comment.