You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.WithMessage("Could not load the cache items of the type 'AutoIndexCache.Tests.TestData.User'. The cache items loader for that cache item type returned a null value. It must return a list of cache items instead.");
130
+
.WithMessage("Could not load the cache items of the type 'AutoIndexCache.Tests.TestData.User'. The cache items loader for that cache item type returned a null reference. It must return a list of cache items instead.");
130
131
}
131
132
132
133
[Test]
@@ -298,7 +299,7 @@ public void GetAllItems_ItemsLoaderReturnsNull_ShouldThrow()
298
299
cache.Invoking(c =>c.Items<User>().GetAllItems())
299
300
.Should()
300
301
.Throw<ItemsLoaderReturnedNullException>()
301
-
.WithMessage("Could not load the cache items of the type 'AutoIndexCache.Tests.TestData.User'. The cache items loader for that cache item type returned a null value. It must return a list of cache items instead.");
302
+
.WithMessage("Could not load the cache items of the type 'AutoIndexCache.Tests.TestData.User'. The cache items loader for that cache item type returned a null reference. It must return a list of cache items instead.");
302
303
}
303
304
304
305
[Test]
@@ -478,4 +479,4 @@ public void UniqueIndex_ShouldReturnUniqueIndex()
#pragma warning disable CS8714// The type cannot be used as type parameter in the generic type or method. Nullability of type argument doesn't match 'notnull' constraint.
10
-
11
7
namespaceAutoIndexCache.Tests;
12
8
13
9
[TestFixture]
@@ -544,4 +540,4 @@ public void GetKeys_ShouldReturnAllKeys()
#pragma warning disable CS8714// The type cannot be used as type parameter in the generic type or method. Nullability of type argument doesn't match 'notnull' constraint.
10
-
11
7
namespaceAutoIndexCache.Tests;
12
8
13
9
[TestFixture]
@@ -629,4 +625,4 @@ public void GetKeys_ShouldReturnAllKeys()
/// Represents a thread-safe, lazy loading cache that automatically indexes cached items.
12
-
/// </summary>
13
-
publicinterfaceIAutoIndexCache
14
-
{
15
-
/// <summary>
16
-
/// Gets the list of cached items of the type <typeparamref name="TItem" /> from this cache.
17
-
/// </summary>
18
-
/// <typeparam name="TItem">The type of cache items to get.</typeparam>
19
-
/// <returns>An instance of <see cref="IItemsList{TItem}" /> that allows to access the cached items of the type <typeparamref name="TItem" />.</returns>
20
-
/// <exception cref="MissingItemsLoaderException">No cache items loader has been set for the cache item type <typeparamref name="TItem" /> yet.</exception>
/// var users = cache.Items<User>().GetAllItems();
27
-
/// ]]>
28
-
/// </code>
29
-
/// </example>
30
-
IItemsList<TItem>Items<TItem>()
31
-
whereTItem:class;
32
-
33
-
/// <summary>
34
-
/// Sets the delegate that loads the cache items of the type <typeparamref name="TItem" /> when cache items of that type are requested from the cache.
35
-
/// If a cache items loader has already been set for the type <typeparamref name="TItem" /> on this instance, the old cache items loader is replaced and the corresponding <see cref="ItemsList{TItem}" /> is reset, so the new cache items loader will be used to load the cache items the next time the cache items are requested from the cache.
36
-
/// </summary>
37
-
/// <typeparam name="TItem">The type of cache items the loader loads.</typeparam>
38
-
/// <param name="itemsLoader">The delegate that loads the cache items of the type <typeparamref name="TItem" />.</param>
39
-
/// <exception cref="ArgumentNullException"><paramref name="itemsLoader" /> is null.</exception>
40
-
/// <remarks>
41
-
/// The specified cache items loader delegate may not return null.
42
-
///
43
-
/// The specified cache items loader delegate may not access the cached items of the type <typeparamref name="TItem" /> inside its method body.
44
-
/// For example, the cache items loader for the cache item type "User" may not call the following methods inside its method body:
45
-
/// <code>
46
-
/// <![CDATA[
47
-
/// - IItemsList<User>.GetAllItems
48
-
/// - IItemsList<User>.Reset
49
-
/// - IItemsList<User>.NonUniqueIndex<TKey>
50
-
/// - IItemsList<User>.UniqueIndex<TKey>
51
-
/// ]]>
52
-
/// </code>
53
-
/// However, the cache items loader is allowed to access cache items of other types.
54
-
/// For example, the cache items loader for the cache item type "User" is allowed call the following methods inside its method body:
55
-
/// <code>
56
-
/// <![CDATA[
57
-
/// - IItemsList<Group>.GetAllItems
58
-
/// - IItemsList<Group>.Reset
59
-
/// - IItemsList<Group>.NonUniqueIndex<TKey>
60
-
/// - IItemsList<Group>.UniqueIndex<TKey>
61
-
/// ]]>
62
-
/// </code>
63
-
/// However, cyclic dependencies are not allowed.
64
-
/// For example, when the cache items loader of the cache item type "User" accesses cache items of the type "Group" and the cache items loader of the type "Group" accesses cache items of the type "User" (meaning User > Group > User) this is not allowed.
0 commit comments