• Share
    • Twitter
    • LinkedIn
    • Facebook
    • Email
  • Feedback
  • Improve this Doc

Class ContentTypeController

ContentTypeController provides the business layer of ContentType.

Inheritance
System.Object
ContentTypeController
Implements
IContentTypeController
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 Source

ContentTypeController()

Initializes a new instance of the ContentTypeController class.

Declaration
public ContentTypeController()
| Improve this Doc View Source

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 Source

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

| Improve this Doc View Source

ClearContentTypeCache()

Clears the content type cache.

Declaration
public void ClearContentTypeCache()
| Improve this Doc View Source

DeleteContentType(ContentType)

Deletes the type of the content.

Declaration
public void DeleteContentType(ContentType contentType)
Parameters
Type Name Description
ContentType contentType

Type of the content.

| Improve this Doc View Source

GetContentTypes()

Gets the content types.

Declaration
public IQueryable<ContentType> GetContentTypes()
Returns
Type Description
IQueryable<ContentType>

content type collection.

| Improve this Doc View Source

UpdateContentType(ContentType)

Updates the type of the content.

Declaration
public void UpdateContentType(ContentType contentType)
Parameters
Type Name Description
ContentType contentType

Type of the content.

Implements

IContentTypeController

Extension Methods

JsonExtensionsWeb.ToJson(Object)
  • View Source
Back to top by the community, for the community... #DNNCMS