Skip to content

Commit 0b629e0

Browse files
authored
Add docs for TArg default methods (#535)
1 parent eab6108 commit 0b629e0

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

BitFaster.Caching/IAsyncCache.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public interface IAsyncCache<K, V> : IEnumerable<KeyValuePair<K, V>>
6464
/// <param name="valueFactory">The factory function used to asynchronously generate a value for the key.</param>
6565
/// <param name="factoryArgument">An argument value to pass into valueFactory.</param>
6666
/// <returns>A task that represents the asynchronous GetOrAdd operation.</returns>
67+
/// <remarks>The default implementation given here is the fallback that provides backwards compatibility for classes that implement ICache on prior versions</remarks>
6768
ValueTask<V> GetOrAddAsync<TArg>(K key, Func<K, TArg, Task<V>> valueFactory, TArg factoryArgument) => this.GetOrAddAsync(key, k => valueFactory(k, factoryArgument));
6869

6970
/// <summary>

BitFaster.Caching/ICache.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public interface ICache<K, V> : IEnumerable<KeyValuePair<K, V>>
6565
/// <param name="factoryArgument">An argument value to pass into valueFactory.</param>
6666
/// <returns>The value for the key. This will be either the existing value for the key if the key is already
6767
/// in the cache, or the new value if the key was not in the cache.</returns>
68+
/// <remarks>The default implementation given here is the fallback that provides backwards compatibility for classes that implement ICache on prior versions</remarks>
6869
V GetOrAdd<TArg>(K key, Func<K, TArg, V> valueFactory, TArg factoryArgument) => this.GetOrAdd(key, k => valueFactory(k, factoryArgument));
6970

7071
/// <summary>

BitFaster.Caching/IScopedAsyncCache.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public interface IScopedAsyncCache<K, V> : IEnumerable<KeyValuePair<K, Scoped<V>
6969
/// <param name="valueFactory">The factory function used to asynchronously generate a scoped value for the key.</param>
7070
/// <param name="factoryArgument"></param>
7171
/// <returns>A task that represents the asynchronous ScopedGetOrAdd operation.</returns>
72+
/// <remarks>The default implementation given here is the fallback that provides backwards compatibility for classes that implement ICache on prior versions</remarks>
7273
ValueTask<Lifetime<V>> ScopedGetOrAddAsync<TArg>(K key, Func<K, TArg, Task<Scoped<V>>> valueFactory, TArg factoryArgument) => this.ScopedGetOrAddAsync(key, (k) => valueFactory(k, factoryArgument));
7374
#endif
7475

BitFaster.Caching/IScopedCache.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public interface IScopedCache<K, V> : IEnumerable<KeyValuePair<K, Scoped<V>>> wh
7272
/// <returns>The lifetime for the value associated with the key. The lifetime will be either reference the
7373
/// existing value for the key if the key is already in the cache, or the new value if the key was not in
7474
/// the cache.</returns>
75+
/// <remarks>The default implementation given here is the fallback that provides backwards compatibility for classes that implement ICache on prior versions</remarks>
7576
Lifetime<V> ScopedGetOrAdd<TArg>(K key, Func<K, TArg, Scoped<V>> valueFactory, TArg factoryArgument) => this.ScopedGetOrAdd(key, k => valueFactory(k, factoryArgument));
7677
#endif
7778

0 commit comments

Comments
 (0)