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()
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.
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
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