/// <summary> /// Creates the reference value for the given entity set name and key value /// </summary> /// <param name="setFullName">the entity set full name</param> /// <param name="keyValue">the key value</param> /// <returns>the refernce value</returns> /// <remarks> /// This will create a "dangling" reference, which Dereference will evaluate to query null value. It's only intended to be used: /// 1. when it's really a "dangling reference /// 2. dumping product output for comparision (in which case, Dereference evaluation is not valid anyway) /// </remarks> public QueryReferenceValue CreateReferenceValue(string setFullName, QueryRecordValue keyValue) { ExceptionUtilities.Assert(keyValue.Type is QueryRecordType, "Create reference value using key needs a value of query record type, not {0}.", keyValue.Type); var referenceValue = new QueryReferenceValue(this, null, this.EvaluationStrategy); referenceValue.SetReferenceValue(setFullName, keyValue); return(referenceValue); }
/// <summary> /// Creates the reference value for the given eneity value /// </summary> /// <param name="entityValue">the entity value</param> /// <returns>the reference value</returns> public QueryReferenceValue CreateReferenceValue(QueryStructuralValue entityValue) { ExceptionUtilities.Assert(entityValue.Type is QueryEntityType, "Create reference value needs a value of query entity type, not {0}.", entityValue.Type); var referenceValue = new QueryReferenceValue(this, null, this.EvaluationStrategy); referenceValue.SetReferenceValue(entityValue); return(referenceValue); }