Skip to content

Commit 3b486c5

Browse files
committed
CacheBase changes
- regrouped members - virtual members that had NotSupportedException as default implementation replaced with abstract - correct copyright
1 parent f434ac9 commit 3b486c5

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Orm/Xtensive.Orm/Caching/CacheBase.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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

Comments
 (0)