Does the EntityDataSource support "it.Property.Property" syntax?

Posted by Orion Adrian on Stack Overflow See other posts from Stack Overflow or by Orion Adrian
Published on 2010-06-09T20:12:25Z Indexed on 2010/06/12 14:32 UTC
Read the original article Hit count: 776

I have an EntityDataSource where I'm trying to replace some previous code-behind work. My EntityDataSource looks like:

    <asp:EntityDataSource 
        runat="server" 
        ID="personDataSource" 
        ContextTypeName="Model.GuidesEntities" 
        EntitySetName="CharacterFavorites" 
        OrderBy="it.Person.FullName" 
        Select="it.Person.Id" 
        Where="it.UserName = @userName" />

When when I actually use it I get the error:

'Person' is not a member of type 'Transient.rowtype[(Id,Edm.Int32(Nullable=True,DefaultValue=))]' in the currently loaded schemas.

Does the EntityDataSource not support walking the relationships? How would you do this with the EntityDataSource?

Also the @userName parameter is being added in the code behind for now. Extra points for anyone who knows how to specify a username parameter directly in the WhereParameters collection.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about entity-framework