Condividi tramite


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

Enables continued reading and writing to an EntityList<TEntity> even after it has been moved to another Web site.

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

Syntax

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

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

Type Parameters

  • T
    The type of the list items.

Parameters

  • newWebUrl
    Type: System.String

    The server-relative, or Web site-relative, URL of the Web site to which the list was moved.

Remarks

If your code moves a list to another Web site, 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.

If the list was not also renamed, newListName and oldListName should be the same value.

If newWebUrl begins with aforward slash ("/"), the URL will be treated as server-relative. If it does not so begin, it will be treated as Web site-relative.

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