1- // Copyright (C) 2007- 2021 Xtensive LLC.
1+ // Copyright (C) 2021 Xtensive LLC.
22// This code is distributed under MIT license terms.
33// See the License.txt file in the project root for more information.
44
@@ -16,25 +16,25 @@ public abstract class CacheBase<TKey, TItem> : ICache<TKey, TItem>
1616 public virtual Converter < TItem , TKey > KeyExtractor { [ DebuggerStepThrough ] get ; protected set ; }
1717
1818 /// <inheritdoc/>
19- public virtual TItem this [ TKey key , bool markAsHit ] => TryGetItem ( key , markAsHit , out var item ) ? item : default ;
19+ public abstract int Count { get ; }
2020
2121 /// <inheritdoc/>
22- public abstract int Count { get ; }
22+ public virtual TItem this [ TKey key , bool markAsHit ] => TryGetItem ( key , markAsHit , out var item ) ? item : default ;
2323
2424 /// <inheritdoc/>
25- public abstract TItem Add ( TItem item , bool replaceIfExists ) ;
25+ public abstract bool TryGetItem ( TKey key , bool markAsHit , out TItem item ) ;
2626
2727 /// <inheritdoc/>
28- public virtual void Add ( TItem item ) => Add ( item , true ) ;
28+ public abstract bool ContainsKey ( TKey key ) ;
2929
3030 /// <inheritdoc/>
31- public virtual void Clear ( ) => throw new NotImplementedException ( ) ;
31+ public abstract TItem Add ( TItem item , bool replaceIfExists ) ;
3232
3333 /// <inheritdoc/>
34- public virtual bool ContainsKey ( TKey key ) => throw new NotImplementedException ( ) ;
34+ public virtual void Add ( TItem item ) => Add ( item , true ) ;
3535
3636 /// <inheritdoc/>
37- public virtual IEnumerator < TItem > GetEnumerator ( ) => throw new NotImplementedException ( ) ;
37+ public abstract void Clear ( ) ;
3838
3939 /// <inheritdoc/>
4040 public virtual void Remove ( TItem item )
@@ -50,7 +50,7 @@ public virtual void Remove(TItem item)
5050 public abstract void RemoveKey ( TKey key , bool removeCompletely ) ;
5151
5252 /// <inheritdoc/>
53- public abstract bool TryGetItem ( TKey key , bool markAsHit , out TItem item ) ;
53+ public abstract IEnumerator < TItem > GetEnumerator ( ) ;
5454 }
5555}
5656
0 commit comments