/// <summary>
 /// Creates a copy of the given value recursively
 /// </summary>
 /// <param name="value">The value to copy</param>
 /// <returns>The copied value</returns>
 public QueryValue Visit(QueryReferenceValue value)
 {
     return(this.HandleCommonCasesAndCache(
                value,
                () =>
     {
         if (value.EntityValue.IsNull)
         {
             var keyCopy = (QueryRecordValue)value.KeyValue.Accept(this);
             return value.Type.CreateReferenceValue(value.EntitySetFullName, keyCopy);
         }
         else
         {
             // no way to create the reference value first. Possible infinite recursion here.
             var entityValueCopy = (QueryStructuralValue)value.EntityValue.Accept(this);
             return value.Type.CreateReferenceValue(entityValueCopy);
         }
     },
                null));
 }
 /// <summary>
 /// Visits a QueryReferenceValue and returns the clr value of the reference value
 /// </summary>
 /// <param name="value">The QueryReferenceValue which contains the clr value of the structural type : complex/entity  type</param>
 /// <returns>The clr instance of the reference value</returns>
 public object Visit(QueryReferenceValue value)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Visits the QueryReferenceValue
 /// </summary>
 /// <param name="value">Value to visit</param>
 /// <returns>will always throw</returns>
 public string Visit(QueryReferenceValue value)
 {
     throw new TaupoNotSupportedException();
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Compares the object with the expected reference value.
 /// </summary>
 /// <param name="expected">Expected value.</param>
 /// <param name="actual">Actual value.</param>
 /// <param name="path">The path to the compared object (for debugging purposes).</param>
 /// <param name="shouldThrow">Should exception be thrown if error is encountered.</param>
 /// <returns>Result of the comparison, Success or Failure.</returns>
 protected virtual ComparisonResult CompareReference(QueryReferenceValue expected, object actual, string path, bool shouldThrow)
 {
     throw new TaupoNotSupportedException("Comparison of query reference value is not supported here.");
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Visits the given QueryValue
 /// </summary>
 /// <param name="value">QueryValue being visited.</param>
 /// <returns>The result of visiting this QueryValue.</returns>
 public QueryValue Visit(QueryReferenceValue value)
 {
     return(value);
 }