Skip to content

Commit d75376b

Browse files
committed
Update README.md
1 parent f08b788 commit d75376b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,9 @@ If you do know the approximate size of your object, you should specify the size
142142
var result = await cache.GetOrCreateAsync<string>(key, duration, async context =>
143143
{
144144
// if your method returns a Task<T> here, you don't have to await if you are just forwarding a method call
145-
// by using the context.Key, you can avoid having to capture the key parameter, saving performance
146-
var value = await MyExpensiveFunctionThatReturnsAStringAsync(context.Key);
145+
var value = await MyExpensiveFunctionThatReturnsAStringAsync();
146+
147+
// if you need the key, you can use context.Key to avoi capturing the key parameter, saving performance
147148
148149
// set the cache duration and size, this is an important step to not miss
149150
// the tuple is minutes, size

0 commit comments

Comments
 (0)