Show / Hide Table of Contents

Class MDOPreferenceCache

Cache for the special preferences used to control MDO lists; to improve performance vs. getting those preferences every time they are needed

Inheritance
object
CacheBaseV2
MDOPreferenceCache
Inherited Members
CacheBaseV2.InstanceDispose()
CacheBaseV2.BeginDisableAutoUpdate()
CacheBaseV2.LoadAsync(CancellationToken)
CacheBaseV2.Load()
CacheBaseV2.Disposed
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: SuperOffice.CRM.Cache
Assembly: SoDataBase.dll
Syntax
[CacheV2(600)]
public class MDOPreferenceCache : CacheBaseV2

Constructors

MDOPreferenceCache()

Cache for the special preferences used to control MDO lists; to improve performance vs. getting those preferences every time they are needed

Declaration
public MDOPreferenceCache()

Fields

DefaultGroupingLowerLimit

Default value for grouping list lower limit (number before list becomes flattened) in the absence of preferences

Declaration
public const int DefaultGroupingLowerLimit = 7
Field Value
Type Description
int

DefaultIsGroupingAllowed

Default value for grouping in the absence of preferences

Declaration
public const bool DefaultIsGroupingAllowed = false
Field Value
Type Description
bool

MDOSectionName

Default value for grouping in the absence of preferences

Declaration
public const string MDOSectionName = "MDOList"
Field Value
Type Description
string

ShowAssociatesInPrimaryGroupOnly

Cache for the special preferences used to control MDO lists; to improve performance vs. getting those preferences every time they are needed

Declaration
public const string ShowAssociatesInPrimaryGroupOnly = "ShowAssociatesInPrimaryGroupOnly"
Field Value
Type Description
string

Properties

TableNames

Gets the names of the table data that are cached in this cache. When these tables are updated the cache will be disposed so a new cache instance can take its place.

Declaration
protected override IEnumerable<string> TableNames { get; }
Property Value
Type Description
IEnumerable<string>
Overrides
CacheBaseV2.TableNames

Methods

GetGroupingLowerLimit(string)

Get the lower limit before grouped lists collapse to flattened (though after filtering)

Declaration
public int GetGroupingLowerLimit(string listName)
Parameters
Type Name Description
string listName

Name of list, case insnesitive

Returns
Type Description
int

Lower limit

GetPreferredSortOrder(string)

Get the preferred sort order. While the interface suggests this can be per list, the current functionality is to have this is a global preference

Declaration
public MDOSortOrder GetPreferredSortOrder(string listName)
Parameters
Type Name Description
string listName

Name of list, case insensitive

Returns
Type Description
MDOSortOrder

Preferred sort order

GetShowAssociatesInPrimaryGroupOnly()

Cache for the special preferences used to control MDO lists; to improve performance vs. getting those preferences every time they are needed

Declaration
public bool GetShowAssociatesInPrimaryGroupOnly()
Returns
Type Description
bool

IsCacheInvalidatedAsync(string, int, PrivateSave, CancellationToken)

Determine if cache was actually invalidated by this change - much of the traffic on the userpreference table does not affect us here

Declaration
protected override Task<bool> IsCacheInvalidatedAsync(string tableName, int primaryKey, PrivateSave save, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string tableName
int primaryKey
PrivateSave save
CancellationToken cancellationToken
Returns
Type Description
Task<bool>
Overrides
CacheBaseV2.IsCacheInvalidatedAsync(string, int, PrivateSave, CancellationToken)
Remarks

This cache is invalidated if a row with section name MDOList is created or updated. It is also affected by the Sorting section, and by Functions.ShowAssociatesInPrimaryGroupOnly Preferences of this sort are never deleted (there's no UI to do that), so we do not track them in the same way we track Sentry preferences.

IsGroupingAllowed(string)

Get whether grouping is turned on for a specific list

Declaration
public bool IsGroupingAllowed(string listName)
Parameters
Type Name Description
string listName

Name of list, case insensitive

Returns
Type Description
bool

True if list is grouped

OnLoad()

Cache for the special preferences used to control MDO lists; to improve performance vs. getting those preferences every time they are needed

Declaration
protected override void OnLoad()
Overrides
CacheBaseV2.OnLoad()

OnLoadAsync(CancellationToken)

Cache for the special preferences used to control MDO lists; to improve performance vs. getting those preferences every time they are needed

Declaration
[CreateSyncVersion(OmitNullableDirective = true)]
protected override Task OnLoadAsync(CancellationToken cancellationToken)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task
Overrides
CacheBaseV2.OnLoadAsync(CancellationToken)

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
ObjectExtensions.AssignByReflection<T>(T, T)
ObjectExtensions.GraphCopy<T>(T)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top