Class RepositoryCachePolicyOptions
Specifies how a repository cache policy should cache entities.
Inheritance
System.Object
Namespace: Umbraco.Cms.Core.Cache
Assembly: Umbraco.Core.dll
Syntax
public class RepositoryCachePolicyOptions
Constructors
View SourceRepositoryCachePolicyOptions()
Ctor - sets GetAllCacheValidateCount = false
Declaration
public RepositoryCachePolicyOptions()
RepositoryCachePolicyOptions(Func<Int32>)
Ctor - sets GetAllCacheValidateCount = true
Declaration
public RepositoryCachePolicyOptions(Func<int> performCount)
Parameters
Type | Name | Description |
---|---|---|
Func<System.Int32> | performCount |
Properties
View SourceGetAllCacheAllowZeroCount
True if the GetAll method will cache that there are zero results so that the db is not hit when there are no results found
Declaration
public bool GetAllCacheAllowZeroCount { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
GetAllCacheValidateCount
True/false as to validate the total item count when all items are returned from cache, the default is true but this means that a db lookup will occur - though that lookup will probably be significantly less expensive than the normal GetAll method.
Declaration
public bool GetAllCacheValidateCount { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
setting this to return false will improve performance of GetAll cache with no params but should only be used for specific circumstances
PerformCount
Callback required to get count for GetAllCacheValidateCount
Declaration
public Func<int>? PerformCount { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<Func<System.Int32>> |