Interface IListItem
- Namespace
- PnP.Core.Model.SharePoint
- Assembly
- PnP.Core.dll
Public interface to define a SharePoint Online list item
public interface IListItem : IDataModel<IListItem>, IDataModelParent, IDataModelWithContext, ISupportModules<IListItem>, IDataModelGet<IListItem>, IDataModelLoad<IListItem>, IDataModelUpdate, IDataModelDelete, IDataModelSupportingGetChanges, ISecurableObject, IExpandoDataModel, IQueryableDataModel
- Inherited Members
- Extension Methods
Properties
All
A special property used to add an asterisk to a $select statement
object All { get; }
Property Value
AttachmentFiles
Collection of attachments for this list item
Implements IQueryable<T>.
See Requesting model collections
and IQueryable performance considerations to learn more.
IAttachmentCollection AttachmentFiles { get; }
Property Value
CommentsDisabled
Determines if comments are disabled for the list item
bool CommentsDisabled { get; }
Property Value
CommentsDisabledScope
The scope for which comments are disabled
CommentsDisabledScope CommentsDisabledScope { get; }
Property Value
ContentType
The content type for the list item
IContentType ContentType { get; }
Property Value
FieldValuesAsHtml
All the field values for the list item as HTML
IFieldStringValues FieldValuesAsHtml { get; }
Property Value
FieldValuesAsText
All the field values for the list item as text
IFieldStringValues FieldValuesAsText { get; }
Property Value
FieldValuesForEdit
All the field values for the list item for editing
IFieldStringValues FieldValuesForEdit { get; }
Property Value
File
The file, if any, associated with the list item
IFile File { get; }
Property Value
FileSystemObjectType
The FileSystemObjectType for the list item, such as Folder or File
FileSystemObjectType FileSystemObjectType { get; }
Property Value
Folder
The folder, if any, represented by the list item
IFolder Folder { get; }
Property Value
Id
Id of the list item
int Id { get; }
Property Value
LikedByInformation
Information about the likes on this list item
ILikedByInformation LikedByInformation { get; }
Property Value
ParentList
The list for the list item
IList ParentList { get; }
Property Value
Properties
The properties of the list item
IPropertyValues Properties { get; }
Property Value
ServerRedirectedEmbedUri
The URI used to render the WOPI (Web Application Open Platform Interface) frame
string ServerRedirectedEmbedUri { get; }
Property Value
ServerRedirectedEmbedUrl
The URL used to render the WOPI (Web Application Open Platform Interface) frame
string ServerRedirectedEmbedUrl { get; }
Property Value
Title
Title value of the list item
string Title { get; set; }
Property Value
UniqueId
The unique identifier of the list item
Guid UniqueId { get; }
Property Value
Versions
Gets a value that returns a collection of list item version objects that represent the versions of the list item
Implements IQueryable<T>.
See Requesting model collections
and IQueryable performance considerations to learn more.
IListItemVersionCollection Versions { get; }
Property Value
Methods
AreCommentsDisabled()
Are comments disabled for this IListItem?
bool AreCommentsDisabled()
Returns
- bool
True if disabled, false otherwise
AreCommentsDisabledAsync()
Are comments disabled for this IListItem?
Task<bool> AreCommentsDisabledAsync()
Returns
CheckIfUserHasPermissions(string, PermissionKind)
Checks if a user has a specific kind of permissions to a listitem
bool CheckIfUserHasPermissions(string userPrincipalName, PermissionKind permissionKind)
Parameters
userPrincipalNamestringLogin name of the user you wish to check if he has a specific permission
permissionKindPermissionKindPermission kind to check
Returns
- bool
Boolean that says if the user has permissions or not
CheckIfUserHasPermissionsAsync(string, PermissionKind)
Checks if a user has a specific kind of permissions to a listitem
Task<bool> CheckIfUserHasPermissionsAsync(string userPrincipalName, PermissionKind permissionKind)
Parameters
userPrincipalNamestringLogin name of the user you wish to check if he has a specific permission
permissionKindPermissionKindPermission kind to check
Returns
CreateAnonymousSharingLink(AnonymousLinkOptions)
Creates an anonymous sharing link for a list item
IGraphPermission CreateAnonymousSharingLink(AnonymousLinkOptions anonymousLinkOptions)
Parameters
anonymousLinkOptionsAnonymousLinkOptions
Returns
- IGraphPermission
Permission that has been created
CreateAnonymousSharingLinkAsync(AnonymousLinkOptions)
Creates an anonymous sharing link for a list item
Task<IGraphPermission> CreateAnonymousSharingLinkAsync(AnonymousLinkOptions anonymousLinkOptions)
Parameters
anonymousLinkOptionsAnonymousLinkOptions
Returns
- Task<IGraphPermission>
Permission that has been created
CreateOrganizationalSharingLink(OrganizationalLinkOptions)
Creates an organization sharing link for a list item
IGraphPermission CreateOrganizationalSharingLink(OrganizationalLinkOptions organizationalLinkOptions)
Parameters
organizationalLinkOptionsOrganizationalLinkOptions
Returns
- IGraphPermission
Permission that has been created
CreateOrganizationalSharingLinkAsync(OrganizationalLinkOptions)
Creates an organization sharing link for a list item
Task<IGraphPermission> CreateOrganizationalSharingLinkAsync(OrganizationalLinkOptions organizationalLinkOptions)
Parameters
organizationalLinkOptionsOrganizationalLinkOptions
Returns
- Task<IGraphPermission>
Permission that has been created
CreateUserSharingLink(UserLinkOptions)
Creates a user sharing link for a list item
IGraphPermission CreateUserSharingLink(UserLinkOptions userLinkOptions)
Parameters
userLinkOptionsUserLinkOptions
Returns
- IGraphPermission
Permission that has been created
CreateUserSharingLinkAsync(UserLinkOptions)
Creates a user sharing link for a list item
Task<IGraphPermission> CreateUserSharingLinkAsync(UserLinkOptions userLinkOptions)
Parameters
userLinkOptionsUserLinkOptions
Returns
- Task<IGraphPermission>
Permission that has been created
GetComments(params Expression<Func<IComment, object>>[])
Get list item comments
ICommentCollection GetComments(params Expression<Func<IComment, object>>[] selectors)
Parameters
selectorsExpression<Func<IComment, object>>[]The expressions declaring the fields to select
Returns
GetCommentsAsync(params Expression<Func<IComment, object>>[])
Get list item comments
Task<ICommentCollection> GetCommentsAsync(params Expression<Func<IComment, object>>[] selectors)
Parameters
selectorsExpression<Func<IComment, object>>[]The expressions declaring the fields to select
Returns
GetDisplayName()
Gets the display name of the list item.
string GetDisplayName()
Returns
- string
The display name or
null.
GetDisplayNameAsync()
Gets the display name of the list item.
Task<string> GetDisplayNameAsync()
Returns
GetParentFolder()
Returns the IFolder that holds this item
IFolder GetParentFolder()
Returns
- IFolder
The IFolder for this item is returned, if the item itself is a folder then the item is returned as IFolder.
GetParentFolderAsync()
Returns the IFolder that holds this item
Task<IFolder> GetParentFolderAsync()
Returns
- Task<IFolder>
The IFolder for this item is returned, if the item itself is a folder then the item is returned as IFolder.
GetUserEffectivePermissions(string)
Gets the user effective permissions of a user for a listitem
IBasePermissions GetUserEffectivePermissions(string userPrincipalName)
Parameters
userPrincipalNamestringLogin name of the user you wish to retrieve the permissions of
Returns
- IBasePermissions
Base permissions object that contains the High and the Low permissions
GetUserEffectivePermissionsAsync(string)
Gets the user effective permissions of a user for a listitem
Task<IBasePermissions> GetUserEffectivePermissionsAsync(string userPrincipalName)
Parameters
userPrincipalNamestringLogin name of the user you wish to retrieve the permissions of
Returns
- Task<IBasePermissions>
Base permissions object that contains the High and the Low permissions
IsFile()
Checks if this IListItem is a file
bool IsFile()
Returns
IsFileAsync()
Checks if this IListItem is a file
Task<bool> IsFileAsync()
Returns
IsFolder()
Checks if this IListItem is a folder
bool IsFolder()
Returns
IsFolderAsync()
Checks if this IListItem is a folder
Task<bool> IsFolderAsync()
Returns
MoveTo(string)
Moves this ListItem to another folder in this list
void MoveTo(string destinationFolderUrl)
Parameters
destinationFolderUrlstringFolder path within this list, e.g. 'subfolder1/subfolder2'
MoveToAsync(string)
Moves this ListItem to another folder in this list
Task MoveToAsync(string destinationFolderUrl)
Parameters
destinationFolderUrlstringFolder path within this list, e.g. 'subfolder1/subfolder2'
Returns
NewFieldLookupValue(IField, int)
Creates a new IFieldLookupValue object
IFieldLookupValue NewFieldLookupValue(IField fieldToUpdate, int lookupId)
Parameters
Returns
- IFieldLookupValue
Configured IFieldLookupValue object
NewFieldTaxonomyValue(IField, Guid, string, int)
Creates a new IFieldTaxonomyValue object
IFieldTaxonomyValue NewFieldTaxonomyValue(IField fieldToUpdate, Guid termId, string label, int wssId = -1)
Parameters
fieldToUpdateIFieldIField representing the field to set
termIdGuidName of the term to set
labelstringLabel of the term to set
wssIdintOptionally provide the wssId value
Returns
- IFieldTaxonomyValue
Configured IFieldTaxonomyValue object
NewFieldUrlValue(IField, string, string)
Creates a new IFieldUrlValue object
IFieldUrlValue NewFieldUrlValue(IField fieldToUpdate, string url, string description = null)
Parameters
fieldToUpdateIFieldIField representing the field to set
urlstringUrl value
descriptionstringOptional description value
Returns
- IFieldUrlValue
Configured IFieldUrlValue object
NewFieldUserValue(IField, ISharePointPrincipal)
Creates a new IFieldUserValue object
IFieldUserValue NewFieldUserValue(IField fieldToUpdate, ISharePointPrincipal principal)
Parameters
fieldToUpdateIFieldIField representing the field to set
principalISharePointPrincipal
Returns
- IFieldUserValue
Configured IFieldUserValue object
NewFieldUserValue(IField, int)
Creates a new IFieldUserValue object
IFieldUserValue NewFieldUserValue(IField fieldToUpdate, int userId)
Parameters
Returns
- IFieldUserValue
Configured IFieldUserValue object
NewFieldValueCollection(IField)
Creates a new collection to hold IFieldValue objects
IFieldValueCollection NewFieldValueCollection(IField fieldToUpdate)
Parameters
Returns
Recycle()
Recycle the current item
Guid Recycle()
Returns
RecycleAsync()
Recycle the current item
Task<Guid> RecycleAsync()
Returns
RecycleBatch()
Recycle the current item
IBatchSingleResult<BatchResultValue<Guid>> RecycleBatch()
Returns
RecycleBatch(Batch)
Recycle the current item
IBatchSingleResult<BatchResultValue<Guid>> RecycleBatch(Batch batch)
Parameters
batchBatchBatch to add the request to
Returns
RecycleBatchAsync()
Recycle the current item
Task<IBatchSingleResult<BatchResultValue<Guid>>> RecycleBatchAsync()
Returns
RecycleBatchAsync(Batch)
Recycle the current item
Task<IBatchSingleResult<BatchResultValue<Guid>>> RecycleBatchAsync(Batch batch)
Parameters
batchBatchBatch to add the request to
Returns
SetCommentsDisabled(bool)
Enable/Disable comments for this list item
void SetCommentsDisabled(bool commentsDisabled)
Parameters
commentsDisabledboolDo comments need to enabled or disabled
SetCommentsDisabledAsync(bool)
Enable/Disable comments for this list item
Task SetCommentsDisabledAsync(bool commentsDisabled)
Parameters
commentsDisabledboolDo comments need to enabled or disabled
Returns
SetComplianceTag(string, bool, bool, bool, bool)
Sets a compliancetag / retention label for this list item
void SetComplianceTag(string complianceTag, bool isTagPolicyHold, bool isTagPolicyRecord, bool isEventBasedTag, bool isTagSuperLock)
Parameters
complianceTagstringThe tag/label to set for this list item
isTagPolicyHoldboolWhether the tag is hold
isTagPolicyRecordboolWhether the tag is record
isEventBasedTagboolWhether the tag is Event based, this is not used
isTagSuperLockboolWhether the tag is Sec 17 tag,no allow change even for site admin
SetComplianceTagAsync(string, bool, bool, bool, bool)
Sets a compliancetag / retention label for this list item
Task SetComplianceTagAsync(string complianceTag, bool isTagPolicyHold, bool isTagPolicyRecord, bool isEventBasedTag, bool isTagSuperLock)
Parameters
complianceTagstringThe tag/label to set for this list item
isTagPolicyHoldboolWhether the tag is hold
isTagPolicyRecordboolWhether the tag is record
isEventBasedTagboolWhether the tag is Event based, this is not used
isTagSuperLockboolWhether the tag is Sec 17 tag,no allow change even for site admin
Returns
SetComplianceTagBatch(Batch, string, bool, bool, bool, bool)
Sets a compliancetag / retention label for this list item
void SetComplianceTagBatch(Batch batch, string complianceTag, bool isTagPolicyHold, bool isTagPolicyRecord, bool isEventBasedTag, bool isTagSuperLock)
Parameters
batchBatchBatch to add the request to
complianceTagstringThe tag/label to set for this list item
isTagPolicyHoldboolWhether the tag is hold
isTagPolicyRecordboolWhether the tag is record
isEventBasedTagboolWhether the tag is Event based, this is not used
isTagSuperLockboolWhether the tag is Sec 17 tag,no allow change even for site admin
SetComplianceTagBatch(string, bool, bool, bool, bool)
Sets a compliancetag / retention label for this list item
void SetComplianceTagBatch(string complianceTag, bool isTagPolicyHold, bool isTagPolicyRecord, bool isEventBasedTag, bool isTagSuperLock)
Parameters
complianceTagstringThe tag/label to set for this list item
isTagPolicyHoldboolWhether the tag is hold
isTagPolicyRecordboolWhether the tag is record
isEventBasedTagboolWhether the tag is Event based, this is not used
isTagSuperLockboolWhether the tag is Sec 17 tag,no allow change even for site admin
SetComplianceTagBatchAsync(Batch, string, bool, bool, bool, bool)
Sets a compliancetag / retention label for this list item
Task SetComplianceTagBatchAsync(Batch batch, string complianceTag, bool isTagPolicyHold, bool isTagPolicyRecord, bool isEventBasedTag, bool isTagSuperLock)
Parameters
batchBatchBatch to add the request to
complianceTagstringThe tag/label to set for this list item
isTagPolicyHoldboolWhether the tag is hold
isTagPolicyRecordboolWhether the tag is record
isEventBasedTagboolWhether the tag is Event based, this is not used
isTagSuperLockboolWhether the tag is Sec 17 tag,no allow change even for site admin
Returns
SetComplianceTagBatchAsync(string, bool, bool, bool, bool)
Sets a compliancetag / retention label for this list item
Task SetComplianceTagBatchAsync(string complianceTag, bool isTagPolicyHold, bool isTagPolicyRecord, bool isEventBasedTag, bool isTagSuperLock)
Parameters
complianceTagstringThe tag/label to set for this list item
isTagPolicyHoldboolWhether the tag is hold
isTagPolicyRecordboolWhether the tag is record
isEventBasedTagboolWhether the tag is Event based, this is not used
isTagSuperLockboolWhether the tag is Sec 17 tag,no allow change even for site admin
Returns
SystemUpdate()
Performs a system update of the list item
void SystemUpdate()
SystemUpdateAsync()
Performs a system update of the list item
Task SystemUpdateAsync()
Returns
SystemUpdateBatch()
Performs a system update of the list item
void SystemUpdateBatch()
SystemUpdateBatch(Batch)
Performs a system update of the list item
void SystemUpdateBatch(Batch batch)
Parameters
batchBatchBatch to add the systemupdate request to
SystemUpdateBatchAsync()
Performs a system update of the list item
Task SystemUpdateBatchAsync()
Returns
SystemUpdateBatchAsync(Batch)
Performs a system update of the list item
Task SystemUpdateBatchAsync(Batch batch)
Parameters
batchBatchBatch to add the systemupdate request to
Returns
UpdateOverwriteVersion()
Performs a UpdateOverwriteVersion of the list item
void UpdateOverwriteVersion()
UpdateOverwriteVersionAsync()
Performs a UpdateOverwriteVersion of the list item
Task UpdateOverwriteVersionAsync()
Returns
UpdateOverwriteVersionBatch()
Performs a UpdateOverwriteVersion of the list item
void UpdateOverwriteVersionBatch()
UpdateOverwriteVersionBatch(Batch)
Performs a UpdateOverwriteVersion of the list item
void UpdateOverwriteVersionBatch(Batch batch)
Parameters
batchBatchBatch to add the UpdateOverwriteVersion request to
UpdateOverwriteVersionBatchAsync()
Performs a UpdateOverwriteVersion of the list item
Task UpdateOverwriteVersionBatchAsync()
Returns
UpdateOverwriteVersionBatchAsync(Batch)
Performs a UpdateOverwriteVersion of the list item
Task UpdateOverwriteVersionBatchAsync(Batch batch)
Parameters
batchBatchBatch to add the UpdateOverwriteVersion request to