diff --git a/Microsoft.Toolkit.Mvvm/Microsoft.Collections.Extensions/DictionarySlim{TKey,TValue}.cs b/Microsoft.Toolkit.Mvvm/Microsoft.Collections.Extensions/DictionarySlim{TKey,TValue}.cs index c9acfd2a..2c1862ac 100644 --- a/Microsoft.Toolkit.Mvvm/Microsoft.Collections.Extensions/DictionarySlim{TKey,TValue}.cs +++ b/Microsoft.Toolkit.Mvvm/Microsoft.Collections.Extensions/DictionarySlim{TKey,TValue}.cs @@ -29,7 +29,7 @@ namespace Microsoft.Collections.Extensions /// 3) This means it can avoid storing a comparer, and avoid the likely virtual call to a comparer. /// [DebuggerDisplay("Count = {Count}")] - internal sealed class DictionarySlim + internal sealed class DictionarySlim : IDictionary where TKey : struct, IEquatable { // See info in CoreFX labs for how this works @@ -71,7 +71,7 @@ namespace Microsoft.Collections.Extensions _entries = InitialEntries; } - /// + /// public bool Remove(TKey key) { Entry[] entries = _entries; diff --git a/Microsoft.Toolkit.Mvvm/Microsoft.Collections.Extensions/IDictionary{TKey}.cs b/Microsoft.Toolkit.Mvvm/Microsoft.Collections.Extensions/IDictionary{TKey}.cs new file mode 100644 index 00000000..e4976feb --- /dev/null +++ b/Microsoft.Toolkit.Mvvm/Microsoft.Collections.Extensions/IDictionary{TKey}.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +namespace Microsoft.Collections.Extensions +{ + /// + /// An interface providing value-invariant access to a instance. + /// + /// The type of keys in the dictionary. + internal interface IDictionary + where TKey : struct, IEquatable + { + /// + bool Remove(TKey key); + } +}