DEREF (Entity SQL)
Dereferences a reference value and produces the result of that dereference.
SELECT DEREF ( o.expression ) FROM Table AS o;
Any valid query expression that returns a collection.
The value of the entity that is referenced.
The DEREF operator dereferences a reference value and produces the result of that dereference. For example, if
r is a reference of type ref<T>,
Deref(r) is an expression of type
T that yields the entity referenced by
r. If the reference value is null, or is dangling (that is, the target of the reference does not exist), the result of the DEREF operator is null.
The following Entity SQL query uses the DEREF operator to dereference a reference value and produce the result of that dereference. The query is based on the AdventureWorks Sales Model. To compile and run this query, follow these steps:
Follow the procedure in How to: Execute a Query that Returns PrimitiveType Results.
Pass the following query as an argument to the ExecutePrimitiveTypeQuery method:
SELECT VALUE DEREF(REF(p)).Name FROM AdventureWorksEntities.Products AS p