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.Content
Assembly: 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# Copy imageCopy Code
[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

See Also