Repository navigation
Expand file tree
/
Copy pathIObservableCache.cs
More file actions
48 lines (41 loc) · 1.42 KB
/
Copy pathIObservableCache.cs
File metadata and controls
48 lines (41 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright (c) 2011-2023 Roland Pheasant. All rights reserved.
// Roland Pheasant licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
using DynamicData.Kernel;
// ReSharper disable once CheckNamespace
namespace DynamicData;
/// <summary>
/// A cache for observing and querying in memory data. With additional data access operators.
/// </summary>
/// <typeparam name="TObject">The type of the object.</typeparam>
/// <typeparam name="TKey">The type of the key.</typeparam>
public interface IObservableCache<TObject, TKey> : IConnectableCache<TObject, TKey>, IDisposable
where TObject : notnull
where TKey : notnull
{
/// <summary>
/// Gets the total count of cached items.
/// </summary>
int Count { get; }
/// <summary>
/// Gets the Items.
/// </summary>
IEnumerable<TObject> Items { get; }
/// <summary>
/// Gets the keys.
/// </summary>
IEnumerable<TKey> Keys { get; }
/// <summary>
/// Gets the key value pairs.
/// </summary>
IEnumerable<KeyValuePair<TKey, TObject>> KeyValues { get; }
/// <summary>
/// Lookup a single item using the specified key.
/// </summary>
/// <remarks>
/// Fast indexed lookup.
/// </remarks>
/// <param name="key">The key.</param>
/// <returns>An optional with the looked up value.</returns>
Optional<TObject> Lookup(TKey key);
}