Table of contents
TOC
Collapse the table of content
Expand the table of content

FieldAndContentTypeExtensions.AddContentTypeToListByName Method

SharePoint Dev Documents|Last Updated: 5/20/2017
|
1 Contributor

Add content type to list

Namespace:Microsoft.SharePoint.Client
Assembly: OfficeDevPnP.Core.dll

Syntax

public static bool AddContentTypeToListByName(this List list, String contentTypeName, Boolean defaultContent = False, Boolean searchContentTypeInSiteHierarchy = False)

Parameters

list

  Type: Microsoft.SharePoint.Client.List
  List to add content type to

contentTypeName

  Type: System.String
  Name of the content type

(optional) defaultContent

  Type: System.Boolean
  If set true, content type is updated to be default content type for the list

(optional) searchContentTypeInSiteHierarchy

  Type: System.Boolean
  search for content type in site hierarchy

Return Value

Type: bool

See also

© 2018 Microsoft