Search Results for

    Show / Hide Table of Contents

    Class ListItemExtensions

    Extension methods for the ListItem object

    Inheritance
    System.Object
    ListItemExtensions
    Namespace: Microsoft.SharePoint.Client
    Assembly: PnP.Framework.dll
    Syntax
    public static class ListItemExtensions : object

    Methods

    Audiences(ListItem)

    Gets the page audience(s)

    Declaration
    public static AudienceEntity Audiences(this ListItem item)
    Parameters
    ListItem item

    Page list item

    Returns
    AudienceEntity

    Page layout defined for this page

    FieldExists(ListItem, String)

    Checks if a listitem contains a field

    Declaration
    public static bool FieldExists(this ListItem item, string fieldName)
    Parameters
    ListItem item

    List item to check

    System.String fieldName

    Name of the field to check

    Returns
    System.Boolean

    FieldExistsAndUsed(ListItem, String)

    Checks if a listitem contains a field with a value

    Declaration
    public static bool FieldExistsAndUsed(this ListItem item, string fieldName)
    Parameters
    ListItem item

    List item to check

    System.String fieldName

    Name of the field to check

    Returns
    System.Boolean

    GetFieldValueAs<T>(ListItem, String)

    Gets the field value (if the field exists and a value is set) in the given type

    Declaration
    public static T GetFieldValueAs<T>(this ListItem item, string fieldName)
    Parameters
    ListItem item

    List item to get the field from

    System.String fieldName

    Name of the field to get the value from

    Returns
    T

    Value of the field in the requested type or null if unable to cast

    Type Parameters
    T

    Type to get the fieldValue in

    LastModifiedBy(ListItem)

    Gets the page last modified by

    Declaration
    public static string LastModifiedBy(this ListItem item)
    Parameters
    ListItem item

    Page list item

    Returns
    System.String

    Last modified by user/account

    LastModifiedDateTime(ListItem)

    Gets the page last modified date time

    Declaration
    public static DateTime LastModifiedDateTime(this ListItem item)
    Parameters
    ListItem item

    Page list item

    Returns
    DateTime

    DateTime of the last modification

    LastPublishedDateTime(ListItem)

    Gets the blog last published date time

    Declaration
    public static DateTime LastPublishedDateTime(this ListItem item)
    Parameters
    ListItem item

    Page list item

    Returns
    DateTime

    DateTime of the last modification

    PageLayout(ListItem)

    Gets the page page layout

    Declaration
    public static string PageLayout(this ListItem item)
    Parameters
    ListItem item

    Page list item

    Returns
    System.String

    Page layout defined for this page

    PageLayoutFile(ListItem)

    Gets the page page layout file

    Declaration
    public static string PageLayoutFile(this ListItem item)
    Parameters
    ListItem item

    Page list item

    Returns
    System.String

    Page layout file defined for this page

    PageType(ListItem)

    Determines the type of page

    Declaration
    public static string PageType(this ListItem item)
    Parameters
    ListItem item

    Page list item

    Returns
    System.String

    Type of page

    Transform(ListItem, PageTransformationInformation)

    Transforms a classic wiki/webpart page into a modern page, using the default page transformation model (webpartmapping.xml)

    Declaration
    public static void Transform(this ListItem sourcePage, PageTransformationInformation pageTransformationInformation)
    Parameters
    ListItem sourcePage

    ListItem for the classic wiki/webpart page

    PageTransformationInformation pageTransformationInformation

    Information to drive the page transformation process

    Transform(ListItem, PageTransformationInformation, String)

    Transforms a classic wiki/webpart page into a modern page using a custom transformation model

    Declaration
    public static void Transform(this ListItem sourcePage, PageTransformationInformation pageTransformationInformation, string pageTransformationFile)
    Parameters
    ListItem sourcePage

    ListItem for the classic wiki/webpart page

    PageTransformationInformation pageTransformationInformation

    Information to drive the page transformation process

    System.String pageTransformationFile

    Page transformation model to be used

    WebParts(ListItem, PageTransformation)

    Gets the web part information from the page

    Declaration
    public static Tuple<PageLayout, List<WebPartEntity>> WebParts(this ListItem item, PageTransformation pageTransformation)
    Parameters
    ListItem item

    Page list item

    PageTransformation pageTransformation

    PageTransformation model loaded from XML

    Returns
    Tuple<PageLayout, List<WebPartEntity>>

    Page layout + collection of web parts on the page

    Back to top PnP Framework
    Generated by DocFX with Material UI
    spacer