SubmitOperation Class
WCF RIA Services
[WCF RIA Services Version 1 Service Pack 2 is compatible with either .NET framework 4 or .NET Framework 4.5, and with either Silverlight 4 or Silverlight 5.]
Represents an asynchronous submit operation.
System.Object
System.ServiceModel.DomainServices.Client.OperationBase
System.ServiceModel.DomainServices.Client.SubmitOperation
System.ServiceModel.DomainServices.Client.OperationBase
System.ServiceModel.DomainServices.Client.SubmitOperation
Namespace: System.ServiceModel.DomainServices.Client
Assembly: System.ServiceModel.DomainServices.Client (in System.ServiceModel.DomainServices.Client.dll)
The SubmitOperation type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | CanCancel | Gets a value that indicates whether this OperationBase is currently in a state that enables it to be canceled. (Inherited from OperationBase.) |
![]() | ChangeSet | Gets change set being submitted. |
![]() | EntitiesInError | Gets any entities that have errors after the submit operation completes. |
![]() | Error | Gets the operation error if the operation failed. (Inherited from OperationBase.) |
![]() | HasError | Gets a value that indicates whether the operation failed. (Inherited from OperationBase.) |
![]() | IsCanceled | Gets a value that indicates whether this operation has been canceled. (Inherited from OperationBase.) |
![]() | IsComplete | Gets a value that indicates whether this operation has completed. (Inherited from OperationBase.) |
![]() | IsErrorHandled | Gets or sets a value that indicates whether the operation error has been handled. (Inherited from OperationBase.) |
![]() | Result | Gets the result of the asynchronous operation. (Inherited from OperationBase.) |
![]() | SupportsCancellation | Gets a value that indicates whether this operation supports cancellation. (Inherited from OperationBase.) |
![]() | UserState | Gets the optional user state for this operation. (Inherited from OperationBase.) |
| Name | Description | |
|---|---|---|
![]() | Cancel | Cancels the operation. (Inherited from OperationBase.) |
![]() | CancelCore | When overridden in a derived class, provides the logic to cancel the operation. (Inherited from OperationBase.) |
![]() | Complete(Exception) | Completes a failed operation with the specified error. (Inherited from OperationBase.) |
![]() | Complete(Object) | Completes a successful operation with the specified result. (Inherited from OperationBase.) |
![]() | Equals | (Inherited from Object.) |
![]() | Finalize | (Inherited from Object.) |
![]() | GetHashCode | (Inherited from Object.) |
![]() | GetType | (Inherited from Object.) |
![]() | InvokeCompleteAction | Invokes the completion callback. (Inherited from OperationBase.) |
![]() | MarkErrorAsHandled | Specifies that an error encountered in an operation is handled. (Inherited from OperationBase.) |
![]() | MemberwiseClone | (Inherited from Object.) |
![]() | OnPropertyChanged | Called when the value of a property changes. (Inherited from OperationBase.) |
![]() | RaisePropertyChanged | Raises the System#ComponentModel#INotifyPropertyChanged#PropertyChanged event. (Inherited from OperationBase.) |
![]() | ToString | (Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() ![]() | INotifyPropertyChanged.PropertyChanged | Occurs when a property value changes. (Inherited from OperationBase.) |
The following example shows a callback method named OnSubmitCompleted that accepts a SubmitOperation object as a parameter. It uses this object to check for errors and mark the errors as handled.
Private Sub SaveButton_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) _customerContext.SubmitChanges(AddressOf OnSubmitCompleted, Nothing) End Sub Private Sub RejectButton_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) _customerContext.RejectChanges() CheckChanges() End Sub Private Sub CustomerGrid_RowEditEnded(ByVal sender As System.Object, ByVal e As System.Windows.Controls.DataGridRowEditEndedEventArgs) CheckChanges() End Sub Private Sub CheckChanges() Dim changeSet = _customerContext.EntityContainer.GetChanges() ChangeText.Text = changeSet.ToString() Dim hasChanges = _customerContext.HasChanges SaveButton.IsEnabled = hasChanges RejectButton.IsEnabled = hasChanges End Sub Private Sub OnSubmitCompleted(ByVal so As SubmitOperation) If (so.HasError) Then MessageBox.Show(String.Format("Submit Failed: {0}", so.Error.Message)) so.MarkErrorAsHandled() End If CheckChanges() End Sub
Show:

