Class DataClassInfoProvider
- Namespace
- CMS.DataEngine
- Assembly
- CMS.DataEngine.dll
Provides access to data class information.
public class DataClassInfoProvider : DataClassInfoProviderBase<DataClassInfoProvider>, IInfoProvider, ICustomizableProvider, IBulkOperationProvider, IWebFarmProvider, IInfoValidator<DataClassInfo>, IInfoProvider<DataClassInfo>, IInfoByIdProvider<DataClassInfo>, IInfoByGuidProvider<DataClassInfo>, IInfoByNameProvider<DataClassInfo>, IBulkInfoProvider<DataClassInfo>
- Inheritance
-
objectDataClassInfoProvider
- Implements
- Inherited Members
- Extension Methods
Constructors
DataClassInfoProvider()
public DataClassInfoProvider()
Fields
ALL_CLASSNAMES
Supplementary constant to specify all class names.
[Obsolete("Constant is deprecated and will be removed in the next version.")]
public const string ALL_CLASSNAMES = "##ALL##"
Field Value
- string
UseDataQueryForSchema
If true, the data query is used for getting the class schema from the database
[Obsolete("Property is deprecated and will be removed in the next version.")]
public static BoolAppSetting UseDataQueryForSchema
Field Value
ZERO_TIME
Zero time constant.
[Obsolete("Constant is deprecated and will be removed in the next version.")]
public static DateTime ZERO_TIME
Field Value
- DateTime
Methods
DeleteInfo(DataClassInfo)
Deletes the object to the database.
protected override void DeleteInfo(DataClassInfo info)
Parameters
infoDataClassInfoObject to delete
GetClassName(int)
Gets the specified DataClassName.
public static string GetClassName(int classId)
Parameters
classIdint
Returns
- string
GetDataClassInfo(string, bool)
Returns DataClassInfo with specified name.
public static DataClassInfo GetDataClassInfo(string name, bool throwIfNotFound)
Parameters
namestringDataClassInfo name
throwIfNotFoundboolIf true, the call throws an exception in case the data class was not found
Returns
Exceptions
- DataClassNotFoundException
Thrown when the data class with the given class name is not found.
GetDataSet(string)
Gets an empty DataSet created by class XML schema.
[Obsolete("Method is deprecated and will be removed in the next version.")]
public static DataSet GetDataSet(string className)
Parameters
classNamestringClass name
Returns
- DataSet
Exceptions
- DataClassNotFoundException
Thrown when the data class with the given class name is not found.
GetObjectQueryInternal()
Gets the object query for the provider
protected override ObjectQuery<DataClassInfo> GetObjectQueryInternal()
Returns
GetUniqueClassName(string)
Returns unique class name created from the given class name.
public static string GetUniqueClassName(string className)
Parameters
classNamestringBase class name
Returns
- string
LoadAllClasses()
Loads all the classes into the hashtable.
[Obsolete("Method is deprecated and will be removed in the next version.")]
public static void LoadAllClasses()
SetInfo(DataClassInfo)
Inserts or Updates the object to the database.
protected override void SetInfo(DataClassInfo info)
Parameters
infoDataClassInfoObject to insert / update
Validate(DataClassInfo)
Validates whether the info object's state satisfies domain specific constraints and returns the validation result.
public override InfoValidationResult Validate(DataClassInfo info)
Parameters
infoDataClassInfoInfo object to be validated.
Returns
- InfoValidationResult
Returns validation result with IsValid set to true, if
infois valid. Otherwise returns result with the flag set to false and a corresponding error message.
Remarks
Implement IInfoValidator<TInfo> and register it into the system to perform domain specific validation for DataClassInfo. The system invokes the registered validators as part of validation performed by this method.
The default implementation validates the code name to contain only allowed characters and to be unique.
Exceptions
- ArgumentNullException
Thrown when
infois null.
- See Also
-
IInfoValidator<TInfo>
ValidateShortCodeName(DataClassInfo)
Validates the object short code name. Returns true if the short code name is valid.
protected bool ValidateShortCodeName(DataClassInfo info)
Parameters
infoDataClassInfoObject to check
Returns
- bool