// 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, }); }
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; } } }
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); }
/// <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); }
/// <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); }
public void ChooseHighestStubOrChild(ComplexInheritance_Child child, ComplexInheritance_Child[] children) { this.OnChooseHighestStubOrChildInvoking(child, children); base.InvokeAction("ChooseHighestStubOrChild", child, children); this.OnChooseHighestStubOrChildInvoked(); }
partial void OnChooseHighestStubOrChildInvoking(ComplexInheritance_Child child, ComplexInheritance_Child[] children);
partial void OnChildChanging(ComplexInheritance_Child value);
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; } } }
// 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); }
// 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; }
// 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); }
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; }
// 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); }
/// <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); }
/// <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); }
// 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, }; }