This is a migrated thread and some comments may be shown as answers.

Linq Join Query

4 Answers 83 Views
LINQ (LINQ specific questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Delton Phillips
Top achievements
Rank 1
Delton Phillips asked on 20 May 2010, 05:53 PM

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'.



4 Answers, 1 is accepted

Sort by
0
Delton Phillips
Top achievements
Rank 1
answered on 21 May 2010, 04:21 PM
Any help from anywhere? Is anyone else experiencing this problem?
0
Damyan Bogoev
Telerik team
answered on 21 May 2010, 06:10 PM
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.
0
Delton Phillips
Top achievements
Rank 1
answered on 21 May 2010, 10:41 PM
Doesn't work, we're going to roll back to the previous version.
0
Damyan Bogoev
Telerik team
answered on 25 May 2010, 05:34 PM
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.
Tags
LINQ (LINQ specific questions)
Asked by
Delton Phillips
Top achievements
Rank 1
Answers by
Delton Phillips
Top achievements
Rank 1
Damyan Bogoev
Telerik team
Share this question
or