Linq Join Query

5 posts, 0 answers
  1. Delton Phillips
    Delton Phillips avatar
    8 posts
    Member since:
    Mar 2010

    Posted 20 May 2010 Link to this post

    Hi,

    When we had Linq queries that were built using Telerik_OpenAccess_ORM_Express_2010_1_310 which worked perfectly. We upgraded to version Telerik_OpenAccess_ORM_Express_2010_1_312 but now the queries don't work. See below

            public IObjectScopeFactory ObjectScopeFactory { set; get; } 
     
            /// <summary> 
            /// Convenience method to pull the object scope from the factory 
            /// </summary> 
            public IObjectScope ObjectScope 
            { 
                get 
                { 
                    return ObjectScopeFactory.GetObjectScope(); 
                } 
            } 
     
     
                 IQueryable<Message> result = from msg in ObjectScope.Extent<Message>()
                             from prf in ObjectScope.Extent<Profile>()
                             where prf.ProfileId == profileId
                             where msg.Recipients.Contains(prf)
                             select msg;

                return result.ToList();
     
     
     
     
     


    We receive the following exception.

    Unable to cast object of type 'Telerik.OpenAccess.Query.ProjectionIndicationT' to type 'OpenAccessRuntime.DataObjects.query.Node'.



  2. Delton Phillips
    Delton Phillips avatar
    8 posts
    Member since:
    Mar 2010

    Posted 21 May 2010 Link to this post

    Any help from anywhere? Is anyone else experiencing this problem?
  3. DevCraft banner
  4. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 21 May 2010 Link to this post

    Hi Delton Phillips,

    It seems to be an issue in the processing of the Linq query. I recommend you to download the latest internal build where this issue is fixed.
    You could try modifying the Linq query in the following way to use the join statement:

    IQueryable<Message> result = from msg in ObjectScope.Extent<Message>()
                    join prf in ObjectScope.Extent<Profile>() 
                    on msg.ProfileId equals prf.ProfileId
                    where prf.ProfileId == profileId
                    select msg;

    Hope that helps.

    Best wishes,
    Damyan Bogoev
    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.
  5. Delton Phillips
    Delton Phillips avatar
    8 posts
    Member since:
    Mar 2010

    Posted 21 May 2010 Link to this post

    Doesn't work, we're going to roll back to the previous version.
  6. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 25 May 2010 Link to this post

    Hi Delton Phillips,

    In order to reproduce the fault behavior we will have to ask you to provide us with some additional information. Can you please share some more details regarding the classes in the project as well as the version of the product you are using?
    We are looking forward to your reply.

    All the best,
    Damyan Bogoev
    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.
Back to Top
DevCraft banner