I have trawled through the odata.org spec for complex types and can't find anywhere where it says that Complex Types cannot refer to Entities, yet the ODataConventionModelBinder.MapComplexType errors if a Complex type refers to a collection of entities (see SRResources.ComplexTypeRefersToEntityType). The associated comment states that complex types cannot refer to entities, implying it is a deliberate design decision.
This is a huge (and unexpected) problem as it prevents actions returning a complex type that (for example) contains a collection of entities and some associated data - a very common scenario. For example, I have a regular synchronization method that returns a set of statistics and any changed entities.
Why is the restriction there at all?
Comments: Good news is that OData V4 will most probably have support for this. The working draft (link [here](https://www.oasis-open.org/committees/download.php/48587/odata-core-v4.0-wd01-part3-csdl-2013-03-19.doc)).
This is a huge (and unexpected) problem as it prevents actions returning a complex type that (for example) contains a collection of entities and some associated data - a very common scenario. For example, I have a regular synchronization method that returns a set of statistics and any changed entities.
Why is the restriction there at all?
Comments: Good news is that OData V4 will most probably have support for this. The working draft (link [here](https://www.oasis-open.org/committees/download.php/48587/odata-core-v4.0-wd01-part3-csdl-2013-03-19.doc)).