Επεξεργασία

Κοινή χρήση μέσω


LinqDataSourceView Class

Definition

Supports the LinqDataSource control and provides an interface for data-bound controls to perform LINQ data operations.

public ref class LinqDataSourceView : System::Web::UI::DataSourceView, System::Web::UI::IStateManager
public ref class LinqDataSourceView : System::Web::UI::WebControls::ContextDataSourceView
public class LinqDataSourceView : System.Web.UI.DataSourceView, System.Web.UI.IStateManager
public class LinqDataSourceView : System.Web.UI.WebControls.ContextDataSourceView
type LinqDataSourceView = class
    inherit DataSourceView
    interface IStateManager
type LinqDataSourceView = class
    inherit ContextDataSourceView
Public Class LinqDataSourceView
Inherits DataSourceView
Implements IStateManager
Public Class LinqDataSourceView
Inherits ContextDataSourceView
Inheritance
LinqDataSourceView
Inheritance
Implements

Remarks

The LinqDataSourceView class is intended primarily to be used by data-bound controls, and not as a programmable object in page code. Page developers typically use the LinqDataSource control to interact with data.

ASP.NET data source controls contain one or more lists of data, represented by data source view objects. The LinqDataSourceView class extends the DataSourceView class. It defines the capabilities of the LinqDataSource control with which it is associated, and it implements the basic data functionality for the data source control. The LinqDataSourceView class implements the Select, Update, Insert, and Delete operations. It also implements sorting, filtering, and managing settings that are kept in view state.

Although the LinqDataSourceView object is not directly exposed to page developers, many of its properties and methods can be accessed through the LinqDataSource control. The LinqDataSourceView control implements the following data retrieval methods and events and exposes them to page developers and to other callers through the associated LinqDataSource control:

You can sort the data that you retrieve with the LinqDataSource control by adding an OrderBy clause. You can provide a sort expression for the LinqDataSourceView instance by setting the SortExpression property of the DataSourceSelectArguments object that is passed to the Select method. The syntax for the SortExpression property is the same as the syntax for a DataView.Sort property.

The LinqDataSourceView control implements the IStateManager interface and uses view state to track its state across page requests. Implementations of the IsTrackingViewState property and the LoadViewState, SaveViewState, and TrackViewState methods are provided to enable view-state tracking for the control. For more information, see ASP.NET State Management Overview.

Constructors

LinqDataSourceView(LinqDataSource, String, HttpContext)

Initializes a new instance of the LinqDataSourceView class, setting the specified LinqDataSource control as the owner of the current view.

Properties

AutoGenerateOrderByClause

Gets or sets a value that indicates whether the LinqDataSourceView object that is associated with the current LinqDataSource control supports dynamic creation of an OrderBy clause.

AutoGenerateOrderByClause

Gets or sets a value that indicates whether the QueryableDataSourceView object that is associated with the current QueryableDataSource control creates a dynamic an OrderBy clause.

(Inherited from QueryableDataSourceView)
AutoGenerateWhereClause

Gets or sets a value that indicates whether the LinqDataSourceView object that is associated with the current LinqDataSource control supports dynamic creation of a Where clause.

AutoGenerateWhereClause

Gets or sets a value that indicates whether the QueryableDataSourceView object that is associated with the current QueryableDataSource control creates a dynamic Where clause.

(Inherited from QueryableDataSourceView)
AutoPage

Gets or sets a value that indicates whether the LinqDataSourceView object that is associated with the current LinqDataSource control supports automatic paging.

AutoPage

Gets or sets a value that indicates whether the QueryableDataSourceView object that is associated with the current QueryableDataSource control supports paging by default.

(Inherited from QueryableDataSourceView)
AutoSort

Gets or sets a value that indicates whether the LinqDataSourceView object that is associated with the current LinqDataSource control supports automatic sorting.

AutoSort

Gets or sets a value that indicates whether the QueryableDataSourceView object that is associated with the current QueryableDataSource control supports sorting by default.

(Inherited from QueryableDataSourceView)
CanDelete

Gets a value that indicates whether the LinqDataSourceView object that is associated with the current LinqDataSource control supports the delete operation.

CanInsert

Gets a value that indicates whether the LinqDataSourceView object that is associated with the current LinqDataSource control supports the insert operation.

CanPage

Gets a value that indicates whether the LinqDataSourceView object that is associated with the current LinqDataSource control supports paging of retrieved data.

CanRetrieveTotalRowCount

Gets a value that indicates whether the LinqDataSourceView object that is associated with the current LinqDataSource control supports retrieving the total number of data rows, in addition to retrieving the data.

CanSort

Gets a value that indicates whether the LinqDataSourceView object that is associated with the current LinqDataSource control supports a sorted view of the retrieved data.

CanUpdate

Gets a value that indicates whether the LinqDataSourceView object that is associated with the current LinqDataSource control supports the update operation.

Context

Gets or sets the current data context.

(Inherited from ContextDataSourceView)
ContextType

Gets the type of the data context class.

ContextTypeName

Gets or sets the name of the data context class that contains the field or property specified in the TableName property.

DeleteParameters

Gets the parameters collection that contains the parameters that are used during a delete operation.

DeleteParameters

Gets the collection that contains the parameters that are used during a delete operation.

(Inherited from QueryableDataSourceView)
EnableDelete

Gets or sets a value that indicates whether the data source view supports deleting rows.

EnableInsert

Gets or sets a value that indicates whether the data source view supports adding new rows.

EnableObjectTracking

Gets or sets a value that indicates whether changes to the data-context object are tracked.

EnableUpdate

Gets or sets a value that indicates whether the data source view supports updating rows.

EntitySet

Gets or sets the object that contains the value of the data to retrieve.

(Inherited from ContextDataSourceView)
EntitySetName

Gets or sets the name of the property or field in the data-context class that represents a data collection.

(Inherited from ContextDataSourceView)
EntitySetType

Gets or sets the name of the object that is created for an insert, delete, or update operation.

(Inherited from ContextDataSourceView)
EntityType

Gets or sets the object that is created for an insert, delete, or update operation.

(Inherited from ContextDataSourceView)
EntityTypeName

Gets or sets the name of the object that is created for an insert, delete, or update operation.

(Inherited from ContextDataSourceView)
Events

Gets a list of event-handler delegates for the data source view.

(Inherited from DataSourceView)
GroupBy

Gets or sets the name or names of the properties to use during the select operation for grouping data.

GroupBy

Gets or sets the name or names of the properties to use during the select operation for grouping data.

(Inherited from QueryableDataSourceView)
GroupByParameters

Gets a collection of parameters whose values are used to create the GroupBy clause during the select operation.

GroupByParameters

Gets a collection of parameters whose values are used to create the GroupBy clause during the select operation.

(Inherited from QueryableDataSourceView)
InsertParameters

Gets a collection of parameters that are used during the insert operation.

InsertParameters

Gets a collection of parameters that are used during the insert operation.

(Inherited from QueryableDataSourceView)
IsTrackingViewState

Gets a value that indicates whether the LinqDataSourceView object is saving changes to its view state.

IsTrackingViewState

Gets a value that indicates whether the QueryableDataSourceView object is saving changes to its view state.

(Inherited from QueryableDataSourceView)
Name

Gets the name of the data source view.

(Inherited from DataSourceView)
OrderBy

Gets or sets the name or names of the properties to use during the select operation for sorting data.

OrderBy

Gets or sets the name or names of the properties that are used during the select operation to sort data.

(Inherited from QueryableDataSourceView)
OrderByParameters

Gets a collection of parameters that are used to create the OrderBy clause.

OrderByParameters

Gets a collection of parameters that are used during the select operation to sort data.

(Inherited from QueryableDataSourceView)
OrderGroupsBy

Gets or sets the names of the properties to use during the select operation for sorting grouped data.

OrderGroupsBy

Gets or sets the names of the properties that are used during the select operation to sort grouped data.

(Inherited from QueryableDataSourceView)
OrderGroupsByParameters

Gets a collection of parameters that are used to create the OrderGroupsBy clause.

OrderGroupsByParameters

Gets a collection of parameters that are used to create the OrderGroupsBy clause.

(Inherited from QueryableDataSourceView)
SelectNew

Gets or sets the properties and calculated values that are included in the retrieved data.

SelectNew

Gets or sets the properties and calculated values that are included in the retrieved data.

(Inherited from QueryableDataSourceView)
SelectNewParameters

Gets the collection of parameters that are used during a data-retrieval operation.

SelectNewParameters

Gets the collection of parameters that are used during a data-retrieval operation.

(Inherited from QueryableDataSourceView)
StoreOriginalValuesInViewState

Gets or sets a value that indicates that original values from the select operation will be stored in view state when delete or update operations are enabled.

TableName

Gets or sets the name of a property or field of the data context class that contains the data collection.

UpdateParameters

Gets the collection of parameters that are used during an update operation.

UpdateParameters

Gets the collection of parameters that are used during an update operation.

(Inherited from QueryableDataSourceView)
Where

Gets or sets a value that specifies what conditions must be true for a record to be included in the retrieved data.

Where

Gets or sets a value that specifies what conditions must be true for a row to be included in the retrieved data.

(Inherited from QueryableDataSourceView)
WhereParameters

Gets a collection of parameters that are used to create the Where clause.

WhereParameters

Gets a collection of parameters that are used to create a Where clause.

(Inherited from QueryableDataSourceView)

Methods

BuildDeleteObject(IDictionary, IDictionary, IDictionary<String,Exception>)

Creates the objects to use for the delete operation.

(Inherited from QueryableDataSourceView)
BuildInsertObject(IDictionary, IDictionary<String,Exception>)

Creates the objects to use for the insert operation by using the values to insert and the error message to display if the operation fails.

(Inherited from QueryableDataSourceView)
BuildQuery(DataSourceSelectArguments)

Creates a Select query expression by using the select arguments of the data source.

(Inherited from QueryableDataSourceView)
BuildUpdateObjects(IDictionary, IDictionary, IDictionary, IDictionary<String,Exception>)

Creates the objects to use for the update operation by using the specified values.

(Inherited from QueryableDataSourceView)
CanExecute(String)

Determines whether the specified command can be executed.

(Inherited from DataSourceView)
ClearOriginalValues()

Clears the original values.

(Inherited from QueryableDataSourceView)
CreateContext(DataSourceOperation)

Creates an instance of the data context type using the specified data source operation.

CreateContext(Type)

Creates an instance of the data context type.

CreateQueryContext(DataSourceSelectArguments)

Creates an instance of a query context object that contains the evaluated parameter collections.

(Inherited from QueryableDataSourceView)
Delete(IDictionary, IDictionary, DataSourceViewOperationCallback)

Performs an asynchronous delete operation on the list of data that the DataSourceView object represents.

(Inherited from DataSourceView)
Delete(IDictionary, IDictionary)

Performs a delete operation.

Delete(IDictionary, IDictionary)

Performs a delete operation.

(Inherited from QueryableDataSourceView)
DeleteDataObject(Object, Object, Object)

Deletes a data object from a table.

DeleteObject(Object)

Deletes a data object from a table.

DisposeContext()

Disposes the context after an operation is performed.

(Inherited from ContextDataSourceView)
DisposeContext(Object)

Disposes the data context.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
ExecuteCommand(String, IDictionary, IDictionary, DataSourceViewOperationCallback)

Executes the specified command.

(Inherited from DataSourceView)
ExecuteCommand(String, IDictionary, IDictionary)

Executes the specified command.

(Inherited from DataSourceView)
ExecuteDelete(IDictionary, IDictionary)

Performs a delete operation by using the specified keys and old values.

ExecuteInsert(IDictionary)

Performs an insert operation by using the values specified in a collection.

ExecutePaging(IQueryable, QueryContext)

Executes paging by using the QueryContext object from the QueryableDataSource object.

(Inherited from QueryableDataSourceView)
ExecuteQuery(IQueryable, QueryContext)

Performs a query, sort, or paging operation on the IQueryable<T> object.

(Inherited from QueryableDataSourceView)
ExecuteQueryExpressions(IQueryable, QueryContext)

Executes query expressions by using an IQueryable object and the QueryContext object.

(Inherited from QueryableDataSourceView)
ExecuteSelect(DataSourceSelectArguments)

Performs a data retrieval operation.

ExecuteSorting(IQueryable, QueryContext)

Performs a sorting operation.

(Inherited from QueryableDataSourceView)
ExecuteUpdate(IDictionary, IDictionary, IDictionary)

Performs an update operation.

GetDataObjectType(Type)

Gets the data object type to use for delete, insert, and update operations.

GetDataObjectType(Type)

Retrieves the type of data object to use for the delete, insert, and update operations.

(Inherited from ContextDataSourceView)
GetEntitySetType()

Retrieves the entity set as a property, field, or data context.

(Inherited from ContextDataSourceView)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetOriginalValues(IDictionary)

Retrieves the original values for the specified keys that were stored during the Select operation.

(Inherited from QueryableDataSourceView)
GetSource(QueryContext)

Returns the data source to apply a query to.

GetTableMemberInfo(Type)

Retrieves metadata about the data collection.

GetType()

Gets the Type of the current instance.

(Inherited from Object)
HandleValidationErrors(IDictionary<String,Exception>, DataSourceOperation)

Handles any exceptions that occur when a data operation fails while a data object is being created.

Insert(IDictionary, DataSourceViewOperationCallback)

Performs an asynchronous insert operation on the list of data that the DataSourceView object represents.

(Inherited from DataSourceView)
Insert(IDictionary)

Performs an insert operation.

Insert(IDictionary)

Performs an asynchronous insert operation on the data items that the QueryableDataSourceView object represents.

(Inherited from QueryableDataSourceView)
InsertDataObject(Object, Object, Object)

Inserts a data object into a table.

InsertObject(Object)

Inserts a data object into a LinqDataSourceView object.

LoadViewState(Object)

Restores the previously saved view state for the data source view.

LoadViewState(Object)

Restores the previously saved view state for the data source view.

(Inherited from QueryableDataSourceView)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
OnContextCreated(LinqDataSourceStatusEventArgs)

Raises the ContextCreated event.

OnContextCreating(LinqDataSourceContextEventArgs)

Raises the ContextCreating event.

OnContextDisposing(LinqDataSourceDisposeEventArgs)

Raises the ContextDisposing event.

OnDataSourceViewChanged(EventArgs)

Raises the DataSourceViewChanged event.

(Inherited from DataSourceView)
OnDeleted(LinqDataSourceStatusEventArgs)

Raises the Deleted event.

OnDeleting(LinqDataSourceDeleteEventArgs)

Raises the Deleting event.

OnException(DynamicValidatorEventArgs)

Raises the Exception event when a data operation fails.

OnInserted(LinqDataSourceStatusEventArgs)

Raises the Inserted event after the LinqDataSource control has completed an insert operation.

OnInserting(LinqDataSourceInsertEventArgs)

Raises the Inserting event.

OnQueryCreated(QueryCreatedEventArgs)

Raises the QueryCreated event after the QueryableDataSource control has created an IQueryable object.

(Inherited from QueryableDataSourceView)
OnQueryParametersChanged(Object, EventArgs)

Calls the RaiseViewChanged() method.

(Inherited from QueryableDataSourceView)
OnSelected(LinqDataSourceStatusEventArgs)

Raises the Selected event after the LinqDataSource control has completed a data retrieval operation.

OnSelecting(LinqDataSourceSelectEventArgs)

Raises the Selecting event before the LinqDataSource control performs a data-retrieval operation.

OnUpdated(LinqDataSourceStatusEventArgs)

Raises the Updated event after the LinqDataSource control has completed an update operation.

OnUpdating(LinqDataSourceUpdateEventArgs)

Raises the Updating event before the LinqDataSource control performs an update operation.

RaiseUnsupportedCapabilityError(DataSourceCapabilities)

Called by the RaiseUnsupportedCapabilitiesError(DataSourceView) method to compare the capabilities requested for an ExecuteSelect(DataSourceSelectArguments) operation against those that the view supports.

(Inherited from DataSourceView)
RaiseViewChanged()

Calls the OnDataSourceViewChanged(EventArgs) method.

(Inherited from QueryableDataSourceView)
ResetDataObject(Object, Object)

Resets the object that contains data to its original state.

SaveViewState()

Saves the changes to view state for the LinqDataSourceView control since the time that the page was posted back to the server.

SaveViewState()

Saves changes to view state for the QueryableDataSourceView object since the time that the page was posted to the server.

(Inherited from QueryableDataSourceView)
Select(DataSourceSelectArguments, DataSourceViewSelectCallback)

Gets a list of data asynchronously from the underlying data storage.

(Inherited from DataSourceView)
Select(DataSourceSelectArguments)

Retrieves data from the data source.

StoreOriginalValues(IList, Func<PropertyDescriptor,Boolean>)

Stores the original values from the select operation in the control's view state when delete or update operations are enabled.

(Inherited from QueryableDataSourceView)
StoreOriginalValues(IList)

Stores the original values from the Select operation in the control's view state.

ToString()

Returns a string that represents the current object.

(Inherited from Object)
TrackViewState()

Tracks view state changes.

TrackViewState()

Causes tracking of view-state changes to the server control so that they can be stored in the server control's state.

(Inherited from QueryableDataSourceView)
Update(IDictionary, IDictionary, IDictionary, DataSourceViewOperationCallback)

Performs an asynchronous update operation on the list of data that the DataSourceView object represents.

(Inherited from DataSourceView)
Update(IDictionary, IDictionary, IDictionary)

Performs an update operation.

Update(IDictionary, IDictionary, IDictionary)

Performs an update operation.

(Inherited from QueryableDataSourceView)
UpdateDataObject(Object, Object, Object, Object)

Updates a data object.

UpdateObject(Object, Object)

Updates a data object.

ValidateContextType(Type, Boolean)

Checks whether the data context class derives from DataContext.

ValidateDeleteSupported(IDictionary, IDictionary)

Validates that the conditions exist to perform a delete operation.

ValidateEditSupported()

Validates that the conditions exist to perform an edit operation.

ValidateInsertSupported(IDictionary)

Validates that the conditions exist to perform an insert operation.

ValidateOrderByParameter(String, String)

Validates that the OrderBy parameter value is a valid field name for the automatically generated OrderBy clause.

ValidateParameterName(String)

Verifies that the provided parameter name is valid.

ValidateTableType(Type, Boolean)

Checks whether the type of the class that represents the data table is a generic type.

ValidateUpdateSupported(IDictionary, IDictionary, IDictionary)

Validates that the conditions exist to perform an update operation.

Events

ContextCreated

Occurs after an instance of the context type object has been created.

ContextCreating

Occurs before an instance of the context type object is created.

ContextDisposing

Occurs before disposing the context type object.

DataSourceViewChanged

Occurs when the data source view has changed.

(Inherited from DataSourceView)
Deleted

Occurs when a delete operation has finished.

Deleting

Occurs before a delete operation.

Inserted

Occurs when an insert operation has finished.

Inserting

Occurs before an insert operation.

QueryCreated

Occurs when a query is created.

(Inherited from QueryableDataSourceView)
Selected

Occurs when a data-retrieval operation has completed.

Selecting

Occurs before a data-retrieval operation.

Updated

Occurs when an update operation has finished.

Updating

Occurs before an update operation.

Explicit Interface Implementations

IStateManager.IsTrackingViewState

For a description of this member, see the IsTrackingViewState property.

IStateManager.IsTrackingViewState

When implemented by a class, gets a value that indicates whether a server control is tracking its view-state changes.

(Inherited from QueryableDataSourceView)
IStateManager.LoadViewState(Object)

This API supports the product infrastructure and is not intended to be used directly from your code.

For a description of this member, see LoadViewState(Object).

IStateManager.LoadViewState(Object)

When implemented by a class, loads the server control's previously saved view state for the control.

(Inherited from QueryableDataSourceView)
IStateManager.SaveViewState()

This API supports the product infrastructure and is not intended to be used directly from your code.

For a description of this member, see the SaveViewState() method.

IStateManager.SaveViewState()

When implemented by a class, saves the changes to a server control's view state to an object.

(Inherited from QueryableDataSourceView)
IStateManager.TrackViewState()

This API supports the product infrastructure and is not intended to be used directly from your code.

For a description of this member, see the IStateManagerTrackViewState method.

IStateManager.TrackViewState()

When implemented by a class, gets a value that indicates whether a server control is tracking its view-state changes.

(Inherited from QueryableDataSourceView)

Applies to