Class ContentTypeController
ContentTypeController provides the business layer of ContentType.
Inheritance
System.Object
ContentTypeController
Implements
Namespace: DotNetNuke.Entities.Content
Assembly: DotNetNuke.dll
Syntax
public class ContentTypeController : object, IContentTypeController
Examples
IContentTypeController typeController = new ContentTypeController();
ContentType contentType = (from t in typeController.GetContentTypes()
where t.ContentType == "DesktopModule"
select t).SingleOrDefault();
if(contentType == null)
{
contentType = new ContentType {ContentType = "DesktopModule"};
contentType.ContentTypeId = typeController.AddContentType(contentType);
}
Constructors
| Improve this Doc View SourceContentTypeController()
Initializes a new instance of the ContentTypeController class.
Declaration
public ContentTypeController()
ContentTypeController(IDataService)
Initializes a new instance of the ContentTypeController class.
Declaration
public ContentTypeController(IDataService dataService)
Parameters
Type | Name | Description |
---|---|---|
IDataService | dataService |
Methods
| Improve this Doc View SourceAddContentType(ContentType)
Adds the type of the content.
Declaration
public int AddContentType(ContentType contentType)
Parameters
Type | Name | Description |
---|---|---|
ContentType | contentType | Type of the content. |
Returns
Type | Description |
---|---|
System.Int32 | content type id. |
ClearContentTypeCache()
Clears the content type cache.
Declaration
public void ClearContentTypeCache()
DeleteContentType(ContentType)
Deletes the type of the content.
Declaration
public void DeleteContentType(ContentType contentType)
Parameters
Type | Name | Description |
---|---|---|
ContentType | contentType | Type of the content. |
GetContentTypes()
Gets the content types.
Declaration
public IQueryable<ContentType> GetContentTypes()
Returns
Type | Description |
---|---|
IQueryable<ContentType> | content type collection. |
UpdateContentType(ContentType)
Updates the type of the content.
Declaration
public void UpdateContentType(ContentType contentType)
Parameters
Type | Name | Description |
---|---|---|
ContentType | contentType | Type of the content. |