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);
        }
示例#2
0
        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;
        }
示例#4
0
 /// <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);
 }
示例#6
0
 /// <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);
 }
示例#7
0
 public void ScheduleInvokable(IDataServiceInvokable invokable)
 {
     throw new NotImplementedException();
 }
示例#8
0
 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();
             });
     }
 }
示例#10
0
 internal void ScheduleInvokable(IDataServiceInvokable invokable)
 {
     this.UpdateProvider2.ScheduleInvokable(invokable);
 }
示例#11
0
 /// <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);
 }
示例#13
0
 /// <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);
 }
示例#14
0
 /// <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();
 }
示例#16
0
 /// <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);
 }