Skip to content

Commit 5deb0ae

Browse files
author
Jeff Treuting
committed
Removed some hard-coded chace prefix
They all should be using the DefaultRepositoryConventions.CachePrefix and now they are.
1 parent 8a9598d commit 5deb0ae

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

SharpRepository.Repository/Caching/CachingStrategyBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ public abstract class CachingStrategyBase<T, TKey> : ICachingStrategy<T, TKey>
1313
public string CachePrefix { private get; set; }
1414
protected string TypeFullName { get; set; }
1515
public int? MaxResults { get; set; }
16-
private Type _entityType;
16+
private readonly Type _entityType;
1717

1818
internal CachingStrategyBase()
1919
{
2020
}
2121

2222
internal CachingStrategyBase(int? maxResults, ICachingProvider cachingProvider)
2323
{
24-
CachePrefix = "#Repo";
24+
CachePrefix = DefaultRepositoryConventions.CachePrefix;
2525
CachingProvider = cachingProvider;
2626
MaxResults = maxResults;
2727

SharpRepository.Repository/Caching/CompoundKeyCachingStrategyCommon.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ internal CompoundKeyCachingStrategyCommon() { }
2424

2525
internal CompoundKeyCachingStrategyCommon(int? maxResults, ICachingProvider cachingProvider)
2626
{
27-
CachePrefix = "#Repo";
27+
CachePrefix = DefaultRepositoryConventions.CachePrefix;
2828
CachingProvider = cachingProvider;
2929
MaxResults = maxResults;
3030

SharpRepository.Repository/RepositoryBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ protected RepositoryBase(ICachingStrategy<T, TKey> cachingStrategy = null)
3131

3232
Conventions = new RepositoryConventions();
3333
CachingStrategy = cachingStrategy ?? new NoCachingStrategy<T, TKey>();
34-
CachingStrategy.CachePrefix = DefaultRepositoryConventions.CachePrefix;
34+
// the CachePrefix is set to the default convention in the CachingStrategyBase class, the user to override when passing in an already created CachingStrategy class
3535

3636
_entityType = typeof(T);
3737
_typeName = _entityType.Name;

0 commit comments

Comments
 (0)