SPClaimProvider.EntityTypesContain Method

Checks the entity type.

Namespace:  Microsoft.SharePoint.Administration.Claims
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)


Protected Shared Function EntityTypesContain ( _
    entityTypes As String(), _
    requestedEntityType As String _
) As Boolean
Dim entityTypes As String()
Dim requestedEntityType As String
Dim returnValue As Boolean

returnValue = SPClaimProvider.EntityTypesContain(entityTypes, _
protected static bool EntityTypesContain(
    string[] entityTypes,
    string requestedEntityType


  • entityTypes
    Type: []

    The entity type set that are passed to the requested operation such as the FillResolve() method.

  • requestedEntityType
    Type: System.String

    The entity type that this operation is checking the entityTypes parameter for.

Return Value

Type: System.Boolean
true if the entity type contains the requested entity type; otherwise, false.


The following first code snippet example shows how to use this method if you did not use a custom entity type. Let’s say, you use forms roles. Therefore, if the picker is not asking for forms roles, then your search and resolve methods should not get involved. For example if the picker is configured to just return distribution lists and not form roles then your claims provider should not be returning data.

The second code snippet shows an example with is a custom entity type.


if (!EntityTypesContain(entityTypes, SPClaimEntityTypes.FormsRole))

private bool DoesEntityTypesContainMyCustomType(String[] entityTypes)
            bool result = false;

            result = EntityTypesContain(entityTypes, MyEntityType);

            return result;

See Also


SPClaimProvider Class

SPClaimProvider Members

Microsoft.SharePoint.Administration.Claims Namespace