UserPreference.GetUserPreference Method (Boolean, SPWeb)
Retrieves the Search user preference information.
Namespace: Microsoft.Office.Server.Search.Administration
Assembly: Microsoft.Office.Server.Search (in Microsoft.Office.Server.Search.dll)
Syntax
'Declaration
Public Shared Function GetUserPreference ( _
lookupFromCache As Boolean, _
web As SPWeb _
) As UserPreference
'Usage
Dim lookupFromCache As Boolean
Dim web As SPWeb
Dim returnValue As UserPreference
returnValue = UserPreference.GetUserPreference(lookupFromCache, _
web)
public static UserPreference GetUserPreference(
bool lookupFromCache,
SPWeb web
)
Parameters
lookupFromCache
Type: System.Booleantrue to look up the preference from cache first; otherwise, false to look up the preference from the database directly.
web
Type: Microsoft.SharePoint.SPWebThe web that hosts the Search center.
Return Value
Type: Microsoft.Office.Server.Search.Administration.UserPreference
The Search user preference information.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | web parameter is null -or- The system ID of the user is null . |
Remarks
If the user is anonymous or the user does not have permission to browse to the preference, this method creates a default preference.