public static IDataServiceInvokable CreateServiceActionInvokable(DataServiceOperationContext operationContext, IDataServiceActionProvider actionProvider, ServiceAction serviceAction, object[] parameterTokens) { WebUtil.CheckArgumentNull <DataServiceOperationContext>(operationContext, "operationContext"); WebUtil.CheckArgumentNull <IDataServiceActionProvider>(actionProvider, "actionProvider"); WebUtil.CheckArgumentNull <ServiceAction>(serviceAction, "serviceAction"); IDataServiceInvokable invokable = actionProvider.CreateInvokable(operationContext, serviceAction, parameterTokens); WebUtil.CheckResourceExists(invokable != null, serviceAction.Name); return(invokable); }
public static IDataServiceInvokable CreateServiceActionInvokable(DataServiceOperationContext operationContext, IDataServiceActionProvider actionProvider, ServiceAction serviceAction, object[] parameterTokens) { WebUtil.CheckArgumentNull(operationContext, "operationContext"); WebUtil.CheckArgumentNull(actionProvider, "actionProvider"); WebUtil.CheckArgumentNull(serviceAction, "serviceAction"); operationContext.CurrentDataService.ProcessingPipeline.AssertAndUpdateDebugStateAtInvokeServiceAction(operationContext.CurrentDataService); IDataServiceInvokable result = actionProvider.CreateInvokable(operationContext, serviceAction, parameterTokens); WebUtil.CheckResourceExists(result != null, serviceAction.Name); return(result); }
/// <summary> /// Updates the RequestEnumerable of <paramref name="actionSegment"/> with the actual results from the invokable. /// </summary> /// <param name="actionSegment">SegmentInfo instance for the service action.</param> internal static void ResolveActionResult(SegmentInfo actionSegment) { Debug.Assert(actionSegment.IsServiceActionSegment, "IsServiceActionSegment(actionSegment)"); Debug.Assert(actionSegment.Operation.ResultKind != ServiceOperationResultKind.Void, "actionSegment.Operation.ResultKind != ServiceOperationResultKind.Void"); Debug.Assert(actionSegment.RequestEnumerable != null, "actionSegment.RequestEnumerable != null"); IDataServiceInvokable invokable = DataServiceActionProviderWrapper.CreateInvokableFromSegment(actionSegment); object result = invokable.GetResult(); if (result != null && actionSegment.SingleResult && !(result is IQueryable)) { result = new object[] { result }; } actionSegment.RequestEnumerable = (IEnumerable)result; }
/// <summary> /// Adds an invokable to list of operations occuring in savechanges /// </summary> /// <param name="invokable">Action to invoke at save changes</param> public virtual void ScheduleInvokable(IDataServiceInvokable invokable) { if (DataServiceOverrides.UpdateProvider2.ImmediateCreateInvokableFunc != null) { DataServiceOverrides.UpdateProvider2.ImmediateCreateInvokableFunc(invokable); } else if (DataServiceOverrides.UpdateProvider2.AddPendingActionsCreateInvokableFunc != null) { this.pendingChanges.Add( () => { DataServiceOverrides.UpdateProvider2.AddPendingActionsCreateInvokableFunc(invokable); }); } else { this.pendingChanges.Add( () => { invokable.Invoke(); }); } }
/// <summary> /// Queues up the <paramref name="invokable"/> to be invoked during IUpdatable.SaveChanges(). /// </summary> /// <param name="invokable">The invokable instance whose Invoke() method will be called during IUpdatable.SaveChanges().</param> public virtual void ScheduleInvokable(IDataServiceInvokable invokable) { this.innerProvider.ScheduleInvokable(invokable); }
/// <summary> /// Queues up the <paramref name="invokable"/> to be invoked during IUpdatable.SaveChanges(). /// </summary> /// <param name="invokable">The invokable instance whose Invoke() method will be called during IUpdatable.SaveChanges().</param> internal void ScheduleInvokable(IDataServiceInvokable invokable) { Debug.Assert(invokable != null, "invokable != null"); this.UpdateProvider2.ScheduleInvokable(invokable); }
public void ScheduleInvokable(IDataServiceInvokable invokable) { throw new NotImplementedException(); }
internal void ScheduleInvokable(IDataServiceInvokable invokable) { this.UpdateProvider2.ScheduleInvokable(invokable); }
/// <summary> /// Adds an invokable to list of operations occuring in savechanges /// </summary> /// <param name="invokable">Action to invoke at save changes</param> public virtual void ScheduleInvokable(IDataServiceInvokable invokable) { if (DataServiceOverrides.UpdateProvider2.ImmediateCreateInvokableFunc != null) { DataServiceOverrides.UpdateProvider2.ImmediateCreateInvokableFunc(invokable); } else if (DataServiceOverrides.UpdateProvider2.AddPendingActionsCreateInvokableFunc != null) { this.pendingChanges.Add( () => { DataServiceOverrides.UpdateProvider2.AddPendingActionsCreateInvokableFunc(invokable); }); } else { this.pendingChanges.Add( () => { invokable.Invoke(); }); } }
internal void ScheduleInvokable(IDataServiceInvokable invokable) { this.UpdateProvider2.ScheduleInvokable(invokable); }
/// <summary> /// Queues up the <paramref name="invokable"/> to be invoked during IUpdatable.SaveChanges(). /// </summary> /// <param name="invokable">The invokable instance whose Invoke() method will be called during IUpdatable.SaveChanges().</param> internal void ScheduleInvokable(IDataServiceInvokable invokable) { Debug.Assert(invokable != null, "invokable != null"); this.UpdateProvider2.ScheduleInvokable(invokable); }
public virtual void ScheduleInvokable(IDataServiceInvokable invokable) { WebUtil.CheckArgumentNull(invokable, "invokable"); this.actionsToInvoke.Add(invokable); }
/// <summary> /// Queues up the <paramref name="invokable"/> to be invoked during IUpdatable.SaveChanges(). /// </summary> /// <param name="invokable">The invokable instance whose Invoke() method will be called during IUpdatable.SaveChanges().</param> public void ScheduleInvokable(IDataServiceInvokable invokable) { GetCurrentProvider <IDataServiceUpdateProvider2>().ScheduleInvokable(invokable); }
/// <summary> /// Queues up the <paramref name="invokable"/> to be invoked during IUpdatable.SaveChanges(). /// </summary> /// <param name="invokable">The invokable instance whose Invoke() method will be called during IUpdatable.SaveChanges().</param> public void ScheduleInvokable(IDataServiceInvokable invokable) { this.pendingChanges.Add(invokable.Invoke); }
public void ScheduleInvokable(IDataServiceInvokable invokable) { throw new NotImplementedException(); }
/// <summary> /// Queues up the <paramref name="invokable"/> to be invoked during IUpdatable.SaveChanges(). /// </summary> /// <param name="invokable">The invokable instance whose Invoke() method will be called during IUpdatable.SaveChanges().</param> public void ScheduleInvokable(IDataServiceInvokable invokable) { this.pendingChanges.Add(invokable.Invoke); }