1 instantiation of EmptyReadOnlyList
Shared (1)
EmptyCollections\EmptyReadOnlyList.cs (1)
19
public static readonly EmptyReadOnlyList<T> Instance =
new
();
16 references to EmptyReadOnlyList
Shared (14)
EmptyCollections\Empty.cs (3)
24
public static IReadOnlyCollection<T> ReadOnlyCollection<T>() =>
EmptyReadOnlyList
<T>.Instance;
31
public static IEnumerable<T> Enumerable<T>() =>
EmptyReadOnlyList
<T>.Instance;
38
public static IReadOnlyList<T> ReadOnlyList<T>() =>
EmptyReadOnlyList
<T>.Instance;
EmptyCollections\EmptyCollectionExtensions.cs (7)
33
=> collection == null || collection.Count == 0 ?
EmptyReadOnlyList
<T>.Instance : collection;
48
=> collection == null || collection.Count == 0 ?
EmptyReadOnlyList
<T>.Instance : collection;
63
=> list == null || list.Count == 0 ?
EmptyReadOnlyList
<T>.Instance : list;
78
=> list == null || list.Count == 0 ?
EmptyReadOnlyList
<T>.Instance : list;
102
return
EmptyReadOnlyList
<T>.Instance;
108
return
EmptyReadOnlyList
<T>.Instance;
114
return
EmptyReadOnlyList
<T>.Instance;
EmptyCollections\EmptyReadonlyDictionary.cs (3)
24
public IEnumerable<TKey> Keys =>
EmptyReadOnlyList
<TKey>.Instance;
25
public IEnumerable<TValue> Values =>
EmptyReadOnlyList
<TValue>.Instance;
27
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator() =>
EmptyReadOnlyList
<KeyValuePair<TKey, TValue>>.Instance.GetEnumerator();
EmptyCollections\EmptyReadOnlyList.cs (1)
19
public static readonly
EmptyReadOnlyList
<T> Instance = new();
Shared.Tests (2)
EmptyCollections\EmptyCollectionExtensionsTests.cs (1)
65
var
nothing = EmptyReadOnlyList<int>.Instance;
EmptyCollections\EmptyReadOnlyListTests.cs (1)
20
var
instance = EmptyReadOnlyList<int>.Instance;