Share via


RoleDefinitionCollection.GetById method

Returns the role definition with the specified ID from the collection.

Namespace:  Microsoft.SharePoint.Client
Assembly:  Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)

Syntax

'Declaration
Public Function GetById ( _
    id As Integer _
) As RoleDefinition
'Usage
Dim instance As RoleDefinitionCollection
Dim id As Integer
Dim returnValue As RoleDefinition

returnValue = instance.GetById(id)
public RoleDefinition GetById(
    int id
)

Parameters

  • id
    Type: System.Int32

    Specifies the unique identifier of the role definition searched. The value of id does not correspond to the index of the role definition within the collection, but refers to the value of the Id property of the RoleDefinition.

Return value

Type: Microsoft.SharePoint.Client.RoleDefinition
A RoleDefinition object that represents the role definition.

Exceptions

Exception Condition
ArgumentException

The role definition does not exist in the collection at the given scope. Error code: -2147024809.

See also

Reference

RoleDefinitionCollection class

RoleDefinitionCollection members

Microsoft.SharePoint.Client namespace