We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 07a5632 + fb8b1f1 commit a4b8631Copy full SHA for a4b8631
README.md
@@ -70,6 +70,13 @@ cache.GetOrAdd(
70
valueFactory: k => 42,
71
ttl: TimeSpan.FromMilliseconds(100));
72
73
+//handy overload to prevent captures/closures allocation
74
+cache.GetOrAdd(
75
+ key: "answer",
76
+ valueFactory: (k, arg) => 42 + arg.Length,
77
+ ttl: TimeSpan.FromMilliseconds(100),
78
+ factoryArgument: "some state data");
79
+
80
```
81
82
## Tradeoffs
0 commit comments