コード例 #1
0
 // Tests that we can round trip objects with inheritance heirarchies on the server but not on the client.
 public ComplexInheritance_Child GetInheritedMember(ComplexInheritance_Child child)
 {
     return(new ComplexInheritance_Child()
     {
         A1 = child.A1 + 1,
         A2 = child.A2 + 1,
         Z1 = child.Z1 + 1,
         Z2 = child.Z2 + 1,
     });
 }
コード例 #2
0
        private static void ChooseHighestChild(IEnumerable <ComplexInheritance_Child> children)
        {
            foreach (var child in children)
            {
                int sum = child.A1 + child.A2 + child.Z1 + child.Z2;

                if (sum >= highestSum)
                {
                    highestChild = child;
                    highestSum   = sum;
                }
            }
        }
コード例 #3
0
        public IEnumerable <ComplexTypeInheritance_EntityGrandparent> GetStub()
        {
            highestChild = null;
            highestSum   = Int32.MinValue;

            ComplexTypeInheritance_EntityGrandparent[] stubs = new ComplexTypeInheritance_EntityGrandparent[]
            {
                new ComplexTypeInheritance_EntityGrandchild()
                {
                    ID    = 1,
                    Child = new ComplexInheritance_Child()
                    {
                        A1 = 1,
                        A2 = 2,
                        Z1 = 10,
                        Z2 = 20,
                    },
                }
            };

            return(stubs);
        }
コード例 #4
0
 /// <summary>
 /// Asynchronously invokes the 'GetHighestChild' method of the DomainService.
 /// </summary>
 /// <param name="child">The value for the 'child' parameter of this action.</param>
 /// <param name="children">The value for the 'children' parameter of this action.</param>
 /// <param name="callback">Callback to invoke when the operation completes.</param>
 /// <param name="userState">Value to pass to the callback.  It can be <c>null</c>.</param>
 /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
 public InvokeOperation<ComplexInheritance_Child> GetHighestChild(ComplexInheritance_Child child, ComplexInheritance_Child[] children, Action<InvokeOperation<ComplexInheritance_Child>> callback, object userState)
 {
     Dictionary<string, object> parameters = new Dictionary<string, object>();
     parameters.Add("child", child);
     parameters.Add("children", children);
     this.ValidateMethod("GetHighestChild", parameters);
     return this.InvokeOperation<ComplexInheritance_Child>("GetHighestChild", typeof(ComplexInheritance_Child), parameters, true, callback, userState);
 }
コード例 #5
0
 /// <summary>
 /// Invokes the 'ChooseHighestStubOrChild' method of the specified <see cref="ComplexTypeInheritance_EntityGrandchild"/> entity.
 /// </summary>
 /// <param name="grandchild">The <see cref="ComplexTypeInheritance_EntityGrandchild"/> entity instance.</param>
 /// <param name="child">The value for the 'child' parameter for this action.</param>
 /// <param name="children">The value for the 'children' parameter for this action.</param>
 public void ChooseHighestStubOrChild(ComplexTypeInheritance_EntityGrandchild grandchild, ComplexInheritance_Child child, ComplexInheritance_Child[] children)
 {
     grandchild.ChooseHighestStubOrChild(child, children);
 }
コード例 #6
0
 public void ChooseHighestStubOrChild(ComplexInheritance_Child child, ComplexInheritance_Child[] children)
 {
     this.OnChooseHighestStubOrChildInvoking(child, children);
     base.InvokeAction("ChooseHighestStubOrChild", child, children);
     this.OnChooseHighestStubOrChildInvoked();
 }
コード例 #7
0
 partial void OnChooseHighestStubOrChildInvoking(ComplexInheritance_Child child, ComplexInheritance_Child[] children);
コード例 #8
0
 partial void OnChildChanging(ComplexInheritance_Child value);
コード例 #9
0
        private static void ChooseHighestChild(IEnumerable<ComplexInheritance_Child> children)
        {
            foreach (var child in children)
            {
                int sum = child.A1 + child.A2 + child.Z1 + child.Z2;

                if (sum >= highestSum)
                {
                    highestChild = child;
                    highestSum = sum;
                }
            }
        }
コード例 #10
0
        // Tests that we can roundtrip complex types in a custom method.
        public void ChooseHighestStubOrChild(ComplexTypeInheritance_EntityGrandchild grandchild, ComplexInheritance_Child child, ComplexInheritance_Child[] children)
        {
            var entityChildren = new List <ComplexInheritance_Child>();

            entityChildren.Add(grandchild.Child);
            ChooseHighestChild(entityChildren);
            ChooseHighestChild(new ComplexInheritance_Child[] { child });
            ChooseHighestChild(children);
        }
コード例 #11
0
 // Tests that we can roundtrip complex types in an invoke method.
 public ComplexInheritance_Child GetHighestChild(ComplexInheritance_Child child, ComplexInheritance_Child[] children)
 {
     ChooseHighestChild(new ComplexInheritance_Child[] { child });
     ChooseHighestChild(children);
     return highestChild;
 }
コード例 #12
0
 // Tests that we can roundtrip complex types in a custom method.
 public void ChooseHighestStubOrChild(ComplexTypeInheritance_EntityGrandchild grandchild, ComplexInheritance_Child child, ComplexInheritance_Child[] children)
 {
     var entityChildren = new List<ComplexInheritance_Child>();
     entityChildren.Add(grandchild.Child);
     ChooseHighestChild(entityChildren);
     ChooseHighestChild(new ComplexInheritance_Child[] { child });
     ChooseHighestChild(children);
 }
コード例 #13
0
        public IEnumerable<ComplexTypeInheritance_EntityGrandparent> GetStub()
        {
            highestChild = null;
            highestSum = Int32.MinValue;

            ComplexTypeInheritance_EntityGrandparent[] stubs = new ComplexTypeInheritance_EntityGrandparent[]
            {
                new ComplexTypeInheritance_EntityGrandchild()
                {
                    ID = 1,
                    Child = new ComplexInheritance_Child()
                    {
                        A1 = 1,
                        A2 = 2,
                        Z1 = 10,
                        Z2 = 20,
                    },
                }
            };

            return stubs;
        }
コード例 #14
0
 // Tests that we can roundtrip complex types in an invoke method.
 public ComplexInheritance_Child GetHighestChild(ComplexInheritance_Child child, ComplexInheritance_Child[] children)
 {
     ChooseHighestChild(new ComplexInheritance_Child[] { child });
     ChooseHighestChild(children);
     return(highestChild);
 }
コード例 #15
0
 /// <summary>
 /// Asynchronously invokes the 'GetInheritedMember' method of the DomainService.
 /// </summary>
 /// <param name="child">The value for the 'child' parameter of this action.</param>
 /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
 public InvokeOperation<ComplexInheritance_Child> GetInheritedMember(ComplexInheritance_Child child)
 {
     Dictionary<string, object> parameters = new Dictionary<string, object>();
     parameters.Add("child", child);
     this.ValidateMethod("GetInheritedMember", parameters);
     return this.InvokeOperation<ComplexInheritance_Child>("GetInheritedMember", typeof(ComplexInheritance_Child), parameters, true, null, null);
 }
コード例 #16
0
 /// <summary>
 /// Asynchronously invokes the 'GetInheritedMember' method of the DomainService.
 /// </summary>
 /// <param name="child">The value for the 'child' parameter of this action.</param>
 /// <param name="cancellationToken">A cancellation token that can be used to cancel the work</param>
 /// <returns>An operation instance that can be used to manage the asynchronous request.</returns>
 public System.Threading.Tasks.Task<InvokeResult<ComplexInheritance_Child>> GetInheritedMemberAsync(ComplexInheritance_Child child, CancellationToken cancellationToken = default(CancellationToken))
 {
     Dictionary<string, object> parameters = new Dictionary<string, object>();
     parameters.Add("child", child);
     this.ValidateMethod("GetInheritedMember", parameters);
     return this.InvokeOperationAsync<ComplexInheritance_Child>("GetInheritedMember", parameters, true, cancellationToken);
 }
コード例 #17
0
 // Tests that we can round trip objects with inheritance heirarchies on the server but not on the client.
 public ComplexInheritance_Child GetInheritedMember(ComplexInheritance_Child child)
 {
     return new ComplexInheritance_Child()
     {
         A1 = child.A1 + 1,
         A2 = child.A2 + 1,
         Z1 = child.Z1 + 1,
         Z2 = child.Z2 + 1,
     };
 }