Class ProviderHelper
- Namespace
- CMS.DataEngine
- Assembly
- CMS.DataEngine.dll
Helper methods for info providers
public static class ProviderHelper
- Inheritance
-
objectProviderHelper
Methods
ClearHashtables(string, bool)
Clears hashtables for given object type.
public static void ClearHashtables(string objectType, bool logTasks)
Parameters
objectTypestringType of the object
logTasksboolIf true, web farm tasks are logged
GetCodeName(string, int)
Gets the code name by the given ID
public static string GetCodeName(string objectType, int id)
Parameters
objectTypestringObject type
idintObject ID
Returns
- string
GetId(string, string)
Gets the ID by the given code name
public static int GetId(string objectType, string codeName)
Parameters
objectTypestringObject type
codeNamestringObject code name
Returns
- int
GetInfoByFullName(string, string, bool)
Gets the info by its type and full name from the appropriate provider.
public static BaseInfo GetInfoByFullName(string objectType, string fullName, bool exceptionIfObjTypeNotFound = false)
Parameters
objectTypestringObject type
fullNamestringFull name of the object
exceptionIfObjTypeNotFoundboolIf true, an exception is thrown if the provider is not found. If false, the null is returned if provider is not found
Returns
GetInfoByGuid(string, Guid, bool)
Gets the info by its type and GUID from the appropriate provider.
public static BaseInfo GetInfoByGuid(string objectType, Guid guid, bool exceptionIfObjTypeNotFound = false)
Parameters
objectTypestringObject type
guidGuidGUID of the object
exceptionIfObjTypeNotFoundboolIf true, an exception is thrown if the provider is not found. If false, the null is returned if provider is not found
Returns
GetInfoById(string, int, bool)
Gets the info by its type and ID from the appropriate provider.
public static BaseInfo GetInfoById(string objectType, int id, bool exceptionIfObjTypeNotFound = false)
Parameters
objectTypestringObject type
idintID of the object
exceptionIfObjTypeNotFoundboolIf true, an exception is thrown if the object type is not found. If false, the null is returned if the object type is not found
Returns
GetInfoByName(string, string, bool)
Gets the info by its type and code name from the appropriate provider.
public static BaseInfo GetInfoByName(string objectType, string name, bool exceptionIfObjTypeNotFound = false)
Parameters
objectTypestringObject type
namestringName of the object
exceptionIfObjTypeNotFoundboolIf true, an exception is thrown if the provider is not found. If false, the null is returned if provider is not found
Returns
GetInfosByIds(string, IEnumerable<int>)
Gets the info by its type and ID from the appropriate provider.
public static SafeDictionary<int, BaseInfo> GetInfosByIds(string objectType, IEnumerable<int> ids)
Parameters
objectTypestringObject type
idsIEnumerable<int>IDs of the objects
Returns
- SafeDictionary<int, BaseInfo>
InvalidateProvider(string)
Invalidates specific provider.
public static void InvalidateProvider(string objectType)
Parameters
objectTypestringType of the object
LoadHashTables(string, LoadHashtableEnum)
Returns true if the hashtables for specified object type should be loaded with the data. Reflects the AppSettings key "CMSLoadHashtables" + objectType.Replace(".", ""), e.g. CMSLoadHashtablesCMSUser.
public static LoadHashtableEnum LoadHashTables(string objectType, LoadHashtableEnum defaultValue)
Parameters
objectTypestringObject type
defaultValueLoadHashtableEnumDefault value in case the key is not present in the web.config file
Returns
LoadTables(params IProviderDictionary[])
Returns true if the given dictionaries should be loaded.
public static bool LoadTables(params IProviderDictionary[] dictionaries)
Parameters
dictionariesIProviderDictionary[]Dictionaries to check
Returns
- bool
LoadTables(ProviderDictionaryCollection)
Returns true if the given dictionary collection should be loaded.
public static bool LoadTables(ProviderDictionaryCollection collection)
Parameters
collectionProviderDictionaryCollectionCollection to check
Returns
- bool