Skip to content

Commit

Permalink
Prevent API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
GeertvanHorrik committed Apr 10, 2024
1 parent 4264ff0 commit 3937d56
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/Catel.Core/Caching/CacheStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public TValue GetFromCacheOrFetch(TKey key, Func<TValue> code, ExpirationPolicy?
/// <returns>The instance initialized by the <paramref name="code" />.</returns>
/// <exception cref="ArgumentNullException">If <paramref name="key" /> is <c>null</c>.</exception>
/// <exception cref="ArgumentNullException">If <paramref name="code" /> is <c>null</c>.</exception>
public TValue GetFromCacheOrFetch(TKey key, Func<TValue> code, bool @override = false, TimeSpan? expiration = default)
public TValue GetFromCacheOrFetch(TKey key, Func<TValue> code, bool @override = false, TimeSpan expiration = default)
{
ArgumentNullException.ThrowIfNull(code);

Expand Down Expand Up @@ -308,7 +308,7 @@ public Task<TValue> GetFromCacheOrFetchAsync(TKey key, Func<Task<TValue>> code,
/// <summary>
/// Adds a value to the cache associated with to a key asynchronously.
/// <para />
/// Note that this is a wrapper around <see cref="GetFromCacheOrFetch(TKey,System.Func{TValue},bool,TimeSpan?)"/>.
/// Note that this is a wrapper around <see cref="GetFromCacheOrFetch(TKey,System.Func{TValue},bool,TimeSpan)"/>.
/// </summary>
/// <param name="key">The key.</param>
/// <param name="code">The deferred initialization code of the value.</param>
Expand All @@ -317,7 +317,7 @@ public Task<TValue> GetFromCacheOrFetchAsync(TKey key, Func<Task<TValue>> code,
/// <returns>The instance initialized by the <paramref name="code" />.</returns>
/// <exception cref="ArgumentNullException">If <paramref name="key" /> is <c>null</c>.</exception>
/// <exception cref="ArgumentNullException">If <paramref name="code" /> is <c>null</c>.</exception>
public Task<TValue> GetFromCacheOrFetchAsync(TKey key, Func<Task<TValue>> code, bool @override = false, TimeSpan? expiration = default)
public Task<TValue> GetFromCacheOrFetchAsync(TKey key, Func<Task<TValue>> code, bool @override = false, TimeSpan expiration = default)
{
return GetFromCacheOrFetchAsync(key, code, CreateDefaultExpirationPolicy(expiration), @override);
}
Expand All @@ -330,7 +330,7 @@ public Task<TValue> GetFromCacheOrFetchAsync(TKey key, Func<Task<TValue>> code,
/// <param name="override">Indicates if the key exists the value will be overridden.</param>
/// <param name="expiration">The timespan in which the cache item should expire when added.</param>
/// <exception cref="ArgumentNullException">The <paramref name="key" /> is <c>null</c>.</exception>
public void Add(TKey key, TValue @value, bool @override = false, TimeSpan? expiration = default)
public void Add(TKey key, TValue @value, bool @override = false, TimeSpan expiration = default)
{
Add(key, value, CreateDefaultExpirationPolicy(expiration), @override);
}
Expand Down
8 changes: 4 additions & 4 deletions src/Catel.Core/Caching/Interfaces/ICacheStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public interface ICacheStorage<TKey, TValue>
/// <exception cref="ArgumentNullException">If <paramref name="key" /> is <c>null</c>.</exception>
/// <exception cref="ArgumentNullException">If <paramref name="key" /> is <c>null</c>.</exception>
/// <exception cref="ArgumentNullException">If <paramref name="key" /> is <c>null</c>.</exception>
TValue GetFromCacheOrFetch(TKey key, Func<TValue> code, bool @override = false, TimeSpan? expiration = default);
TValue GetFromCacheOrFetch(TKey key, Func<TValue> code, bool @override = false, TimeSpan expiration = default);

/// <summary>
/// Adds a value to the cache associated with to a key.
Expand All @@ -100,7 +100,7 @@ public interface ICacheStorage<TKey, TValue>
/// <param name="override">Indicates if the key exists the value will be overridden.</param>
/// <param name="expiration">The timespan in which the cache item should expire when added.</param>
/// <exception cref="ArgumentNullException">The <paramref name="key" /> is <c>null</c>.</exception>
void Add(TKey key, TValue @value, bool @override = false, TimeSpan? expiration = default);
void Add(TKey key, TValue @value, bool @override = false, TimeSpan expiration = default);

/// <summary>
/// Removes an item from the cache.
Expand Down Expand Up @@ -142,7 +142,7 @@ public interface ICacheStorage<TKey, TValue>
/// <summary>
/// Adds a value to the cache associated with to a key asynchronously.
/// <para />
/// Note that this is a wrapper around <see cref="CacheStorage{TKey,TValue}.GetFromCacheOrFetch(TKey,System.Func{TValue},bool,System.TimeSpan?)"/>.
/// Note that this is a wrapper around <see cref="CacheStorage{TKey,TValue}.GetFromCacheOrFetch(TKey,System.Func{TValue},bool,System.TimeSpan)"/>.
/// </summary>
/// <param name="key">The key.</param>
/// <param name="code">The deferred initialization code of the value.</param>
Expand All @@ -151,6 +151,6 @@ public interface ICacheStorage<TKey, TValue>
/// <returns>The instance initialized by the <paramref name="code" />.</returns>
/// <exception cref="ArgumentNullException">If <paramref name="key" /> is <c>null</c>.</exception>
/// <exception cref="ArgumentNullException">If <paramref name="code" /> is <c>null</c>.</exception>
Task<TValue> GetFromCacheOrFetchAsync(TKey key, Func<Task<TValue>> code, bool @override = false, TimeSpan? expiration = default);
Task<TValue> GetFromCacheOrFetchAsync(TKey key, Func<Task<TValue>> code, bool @override = false, TimeSpan expiration = default);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -546,15 +546,15 @@ namespace Catel.Caching
public event System.EventHandler<Catel.Caching.ExpiredEventArgs<TKey, TValue>>? Expired;
public event System.EventHandler<Catel.Caching.ExpiringEventArgs<TKey, TValue>>? Expiring;
public void Add(TKey key, TValue value, Catel.Caching.Policies.ExpirationPolicy? expirationPolicy, bool override = false) { }
public void Add(TKey key, TValue value, bool override = false, System.TimeSpan? expiration = default) { }
public void Add(TKey key, TValue value, bool override = false, System.TimeSpan expiration = default) { }
public void Clear() { }
public bool Contains(TKey key) { }
protected virtual Catel.Caching.Policies.ExpirationPolicy? CreateDefaultExpirationPolicy(System.TimeSpan? expiration) { }
public TValue? Get(TKey key) { }
public TValue GetFromCacheOrFetch(TKey key, System.Func<TValue> code, Catel.Caching.Policies.ExpirationPolicy? expirationPolicy, bool override = false) { }
public TValue GetFromCacheOrFetch(TKey key, System.Func<TValue> code, bool override = false, System.TimeSpan? expiration = default) { }
public TValue GetFromCacheOrFetch(TKey key, System.Func<TValue> code, bool override = false, System.TimeSpan expiration = default) { }
public System.Threading.Tasks.Task<TValue> GetFromCacheOrFetchAsync(TKey key, System.Func<System.Threading.Tasks.Task<TValue>> code, Catel.Caching.Policies.ExpirationPolicy? expirationPolicy, bool override = false) { }
public System.Threading.Tasks.Task<TValue> GetFromCacheOrFetchAsync(TKey key, System.Func<System.Threading.Tasks.Task<TValue>> code, bool override = false, System.TimeSpan? expiration = default) { }
public System.Threading.Tasks.Task<TValue> GetFromCacheOrFetchAsync(TKey key, System.Func<System.Threading.Tasks.Task<TValue>> code, bool override = false, System.TimeSpan expiration = default) { }
public void Remove(TKey key, System.Action? action = null) { }
}
public class ExpiredEventArgs<TKey, TValue> : System.EventArgs
Expand Down Expand Up @@ -584,14 +584,14 @@ namespace Catel.Caching
event System.EventHandler<Catel.Caching.ExpiredEventArgs<TKey, TValue>>? Expired;
event System.EventHandler<Catel.Caching.ExpiringEventArgs<TKey, TValue>>? Expiring;
void Add(TKey key, TValue value, Catel.Caching.Policies.ExpirationPolicy? expirationPolicy, bool override = false);
void Add(TKey key, TValue value, bool override = false, System.TimeSpan? expiration = default);
void Add(TKey key, TValue value, bool override = false, System.TimeSpan expiration = default);
void Clear();
bool Contains(TKey key);
TValue? Get(TKey key);
TValue GetFromCacheOrFetch(TKey key, System.Func<TValue> code, Catel.Caching.Policies.ExpirationPolicy? expirationPolicy, bool override = false);
TValue GetFromCacheOrFetch(TKey key, System.Func<TValue> code, bool override = false, System.TimeSpan? expiration = default);
TValue GetFromCacheOrFetch(TKey key, System.Func<TValue> code, bool override = false, System.TimeSpan expiration = default);
System.Threading.Tasks.Task<TValue> GetFromCacheOrFetchAsync(TKey key, System.Func<System.Threading.Tasks.Task<TValue>> code, Catel.Caching.Policies.ExpirationPolicy? expirationPolicy, bool override = false);
System.Threading.Tasks.Task<TValue> GetFromCacheOrFetchAsync(TKey key, System.Func<System.Threading.Tasks.Task<TValue>> code, bool override = false, System.TimeSpan? expiration = default);
System.Threading.Tasks.Task<TValue> GetFromCacheOrFetchAsync(TKey key, System.Func<System.Threading.Tasks.Task<TValue>> code, bool override = false, System.TimeSpan expiration = default);
void Remove(TKey key, System.Action? action = null);
}
}
Expand Down

0 comments on commit 3937d56

Please sign in to comment.