I have an EntityDataSource which is to select all the user entities which have certain roles ordered by roleID. (I want to display the users gruoped by role, and therefore the order part is important).
the following code:
<asp:EntityDataSource ID="UserDataSource" runat="server" ConnectionString="name=MyEntities"
DefaultContainerName="MyEntities" EnableFlattening="False"
EntitySetName="Users" Where="EXISTS(SELECT VALUE u FROM it.UserRoles AS u)" OrderBy="it.UserRoles.RoleId">
</asp:EntityDataSource>
produces the following error:
'RoleId' is not a member of 'Transient.collection[MyModel.UserRole(Nullable=True,DefaultValue=)]'. To extract a property of a collection element, use a subquery to iterate over the collection.
Adding Include="UserRoles" is of no help.