Where clause failing in INNER join LINQ

5 posts, 0 answers
  1. FISCAL
    FISCAL avatar
    91 posts
    Member since:
    May 2010

    Posted 24 May 2010 Link to this post

    Hi,

    When I add 'where' clause in the inner join linq query, it is throwing runtime- error.

    Got to resolve many to many scenario -
    1. User table
    2. Organisation table
    3. UserOrganisation table

    LINQ query..


      IEnumerable<UserForGridDisplay> userList = from user in m_scope.Extent<User>()
                                                 join userOrg in m_scope.Extent<UserOrganisation>() on user.UserID equals userOrg.UserID
                                                 join org in m_scope.Extent<Organisation>() on userOrg.OrganisationID equals org.OrganisationID
                                                where org.OrganisationID == orgID //Problem here
                                                 select new UserForGridDisplay
                                                    {
                                                    Forename            = user.UserForename,
                                                    OrganisationName    = org.OrganisationName
                                                    };



    Identifier '<>h__TransparentIdentifier4' is not a parameter or variable or field of 'ORM_ClassLibrary.User'. If '<>h__TransparentIdentifier4' is a property please add the FieldAlias or Storage attribute to it or declare it as a field's alias. 
    Error..


    Any help if highly appreciated.

    Many thanks.

    M G

  2. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 25 May 2010 Link to this post

    Hi M G,

    it looks like an issue that is fixed in the upcoming version as I cannot reproduce it.
    To work around it I would rewrite the query a bit like

    IEnumerable<UserForGridDisplay> userList =  from org in m_scope.Extent<Organisation>()
           where org.OrganisationID == orgID
    join userOrg in m_scope.Extent<UserOrganisation>()
           on org.OrganizationID equals userOrg.OrganizationID
    join user in m_scope.Extent<User>()
          on userOrg.UserID equals user.UserID
                                                 select new UserForGridDisplay
                                                    {
                                                    Forename            = user.UserForename,
                                                    OrganisationName    = org.OrganisationName
                                                    };
     

    All the best,
    Thomas
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. DevCraft banner
  4. FISCAL
    FISCAL avatar
    91 posts
    Member since:
    May 2010

    Posted 25 May 2010 Link to this post

    Hi Thomas,

    Thank you very much for your reply. I amnot sure which version you are refering to when you say "upcomin version". I tried in the last internal build as well :(

    Please let me know when we will get the lastest version with this problem fixed and many other features like supporting SQL  Default values in Reverse mapping process.

    Many thanks.

    Cheers,
    M G
  5. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 25 May 2010 Link to this post

    Hello M G,

    we are in the phase of preparing a new build. I expect 2 additional days for this.

    All the best,

    Thomas
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. kunal
    kunal avatar
    11 posts
    Member since:
    Jan 2009

    Posted 10 Sep 2010 Link to this post

    hey

    Can u please explain me what is IEnumerable<UserForGridDisplay>...
    what is "UserForGridDisplay"????????

    waiting for replay!!!!!!!!!!!!!!
Back to Top
DevCraft banner