Share via


DataContext.RegisterList<T> method (String, String)

Enables continued reading and writing to an EntityList<TEntity> even after it has been renamed.

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

Syntax

'Declaration
Public Sub RegisterList(Of T) ( _
    newListName As String, _
    oldListName As String _
)
'Usage
Dim instance As DataContext
Dim newListName As String
Dim oldListName As String

instance.RegisterList(newListName, oldListName)
public void RegisterList<T>(
    string newListName,
    string oldListName
)

Type parameters

  • T
    The type of the list items.

Parameters

Remarks

If your code renames a list, you can avoid having to dispose and recreate the EntityList<TEntity> by calling this method. Your code can then continue to access the cached list using the new name.

Important

The T parameter is used in conjunction with the oldListName parameter to identify the EntityList<TEntity> that is being re-registered. For that reason T must be given the same value as the generic parameter of the EntityList<TEntity> object. RegisterList() cannot be used to change the content type of the list items.

See also

Reference

DataContext class

DataContext members

RegisterList overload

Microsoft.SharePoint.Linq namespace