The ContentItem class which itself inherits from BaseEntityInfo paves the way for easily adding support for taxonomy,
tagging and other ContentItem dependant features to your DotNetNuke extensions.
Namespace: DotNetNuke.Entities.ContentAssembly: DotNetNuke (in DotNetNuke.dll)
Syntax
C# |
---|
[SerializableAttribute] public class ContentItem : BaseEntityInfo, IHydratable |
Visual Basic |
---|
<SerializableAttribute> Public Class ContentItem Inherits BaseEntityInfo Implements IHydratable |
Remarks
Content Items are a collection of individual pieces of content in a DotNetNuke site. Each content item is associated with a single Content Type.
Only modules that implement content items (done so by the module developers) can take advantage of some of its benefits, such as Taxonomy.
Because ContentItem already implements IHydratable, you will not do so in your custom entity class. Instead, you will need to create overrides of the KeyID property and the Fill method already implemented in the ContentItem class. Don't forget to call ContentItem's FillInternal method in your Fill method override.
Examples
C# | ![]() |
---|---|
[Serializable] public class DesktopModuleInfo : ContentItem, IXmlSerializable { #region IHydratable Members public override void Fill(IDataReader dr) { DesktopModuleID = Null.SetNullInteger(dr["DesktopModuleID"]); PackageID = Null.SetNullInteger(dr["PackageID"]); ModuleName = Null.SetNullString(dr["ModuleName"]); FriendlyName = Null.SetNullString(dr["FriendlyName"]); Description = Null.SetNullString(dr["Description"]); FolderName = Null.SetNullString(dr["FolderName"]); Version = Null.SetNullString(dr["Version"]); base.FillInternal(dr); } #endregion } |
Inheritance Hierarchy
System..::..Object
DotNetNuke.Entities..::..BaseEntityInfo
DotNetNuke.Entities.Content..::..ContentItem
DotNetNuke.Entities.Modules..::..DesktopModuleInfo
DotNetNuke.Entities.Modules..::..ModuleInfo
DotNetNuke.Entities.Tabs..::..TabInfo
DotNetNuke.Entities..::..BaseEntityInfo
DotNetNuke.Entities.Content..::..ContentItem
DotNetNuke.Entities.Modules..::..DesktopModuleInfo
DotNetNuke.Entities.Modules..::..ModuleInfo
DotNetNuke.Entities.Tabs..::..TabInfo