Projecting collection fields not supported yet

2 posts, 0 answers
  1. Liam
    Liam avatar
    13 posts
    Member since:
    Sep 2008

    Posted 23 Feb 2009 Link to this post

    I'm getting the above error in my project when I run the following LINQ query.

    var result = from c in scope.Extent<Company>()  
                             select c.CompanyContacts; 

    Within the generated Company class I have CompanyContacts declared, so I don't think this is the problem.

    In I see the same error has occured and the issue was resolved in a later build of OpenAccess. The version of OpenAccess I'm using was downloaded in January, so this should have the fix included in it.

    As always, any help would be greatly appreciated.

  2. Thomas
    Thomas avatar
    588 posts

    Posted 24 Feb 2009 Link to this post

    Hello Liam,

    in your case the CompanyContacts is a collection field, and projections of a collection field is not supported yet. The other case you mentioned is about projections of scalar values. The only logical result set in your case would be a list of lists; I'm not sure that's what you want. The quickest way to access the collection content is to do a 'from c in scope.Extent<Company>() select c' and use a proper fetch plan in order to have the generated query join in the needed CompanyContact instances.

    Best wishes,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. DevCraft banner
Back to Top