Compartilhar via


SPPersistedChildCollection<T>.Ensure method

Adiciona um objeto à coleção e, se o objeto já existe, reinicializa com os dados de objeto existente.

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

Syntax

'Declaração
Public Overridable Function Ensure ( _
    newObj As T _
) As T
'Uso
Dim instance As SPPersistedChildCollection
Dim newObj As T
Dim returnValue As T

returnValue = instance.Ensure(newObj)
public virtual T Ensure(
    T newObj
)

Parâmetros

  • newObj
    Type: T

    O objeto a ser adicionado à coleção. Se o objeto existe na coleção, ela é reinicializada com os dados de objeto existente.

Valor retornado

Type: T
O objeto que foram adicionado ou atualizado.

Ver também

Referência

SPPersistedChildCollection<T> class

SPPersistedChildCollection<T> members

Microsoft.SharePoint.Administration namespace