private void TestOpenCollectionProperty <TParam, TReturn>(SingleValueNode source, string propertyName, Expression <Func <TParam, TReturn> > expectedExpression) { QueryNode node = new CollectionOpenPropertyAccessNode(source, propertyName); var result = this.testSubject.TranslateNode(node); CompareExpressions(expectedExpression.Body, result); }
/// <summary> /// Translate a CollectionOpenPropertyAccessNode. /// </summary> /// <param name="nodeIn">The node to be translated.</param> /// <returns>The translated node.</returns> public override QueryNode Visit(CollectionOpenPropertyAccessNode nodeIn) { Contract.Assert(nodeIn != null); return(new CollectionOpenPropertyAccessNode( (SingleValueNode)nodeIn.Source.Accept(this), nodeIn.Name)); }
/// <summary> /// Writes collection property access node to string /// </summary> /// <param name="node">Node to write to string</param> /// <returns>String representation of node.</returns> private static string ToString(CollectionOpenPropertyAccessNode node) { return(tabHelper.Prefix + "CollectionOpenPropertyAccessNode" + tabHelper.Indent(() => tabHelper.Prefix + "Name = " + node.Name + tabHelper.Prefix + "Source = " + ToString(node.Source) )); }
/// <summary> /// Visit a CollectionOpenPropertyAccessNode /// </summary> /// <param name="nodeIn">the node to visit</param> /// <returns>true, indicating that the node has been visited.</returns> public override bool Visit(CollectionOpenPropertyAccessNode nodeIn) { validate(nodeIn); // don't validate TypeReferences, only types, as nullability is only meaningful in context of model element validate(nodeIn.CollectionType.CollectionDefinition()); validate(nodeIn.ItemType.Definition); return(true); }
public override QueryNode Visit(CollectionOpenPropertyAccessNode nodeIn) { SingleResourceNode?source = nodeIn.Source == null ? null : (SingleResourceNode)Visit(nodeIn.Source); if (nodeIn.Source != source) { nodeIn = new CollectionOpenPropertyAccessNode(source, nodeIn.Name); } return(nodeIn); }
/// <summary> /// Translate a CollectionOpenPropertyAccessNode. /// </summary> /// <param name="nodeIn">The node to be translated.</param> /// <returns>The translated node.</returns> public override QueryNode Visit(CollectionOpenPropertyAccessNode nodeIn) { if (nodeIn == null) { throw Error.ArgumentNull(nameof(nodeIn)); } return(new CollectionOpenPropertyAccessNode( (SingleValueNode)nodeIn.Source.Accept(this), nodeIn.Name)); }
/// <summary> /// Translates an <see cref="CollectionOpenPropertyAccessNode"/> into a corresponding <see cref="String"/>. /// </summary> /// <param name="node">The node to translate.</param> /// <returns>The translated String.</returns> public override String Visit(CollectionOpenPropertyAccessNode node) { ExceptionUtils.CheckArgumentNotNull(node, "node"); return(this.TranslatePropertyAccess(node.Source, node.Name)); }
/// <summary> /// Translates an <see cref="CollectionOpenPropertyAccessNode"/> into a corresponding <see cref="string"/>. /// </summary> /// <param name="node">The node to translate.</param> /// <returns>The translated string.</returns> public override string Visit(CollectionOpenPropertyAccessNode node) { return(this.TranslatePropertyAccess(node.Source, node.Name)); }
public override object Visit(CollectionOpenPropertyAccessNode nodeIn) { return(null); }
/// <summary> /// Visit an CollectionOpenPropertyAccessNode /// </summary> /// <param name="nodeIn">the node to visit</param> /// <returns>Defined by the implementer</returns> public virtual T Visit(CollectionOpenPropertyAccessNode nodeIn) { throw new NotImplementedException(); }
public override T Visit(CollectionOpenPropertyAccessNode nodeIn) => DebuggerBreakVisited(nodeIn);
public override string Visit(AllNode nodeIn) => WrapBinary(() => $"{nodeIn.Source.Accept(this)}/all({nodeIn.CurrentRangeVariable.Name}: {nodeIn.Body.Accept(this)})"); // return WrapWithIdent(string.Format("AllNode:[{0}<={1}\nExp={2}]", nodeIn.TypeReference, nodeIn.Source.Accept(this),nodeIn.Body.Accept(this))); public override string Visit(CollectionOpenPropertyAccessNode nodeIn) => $"{AcceptAsPrefix(nodeIn.Source)}{nodeIn .Name}"; // return base.Visit(nodeIn);
/// <summary> /// Writes collection property access node to string /// </summary> /// <param name="node">Node to write to string</param> /// <returns>String representation of node.</returns> private static string ToString(CollectionOpenPropertyAccessNode node) { return tabHelper.Prefix + "CollectionOpenPropertyAccessNode" + tabHelper.Indent(() => tabHelper.Prefix + "Name = " + node.Name + tabHelper.Prefix + "Source = " + ToString(node.Source) ); }