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

Error - Must specify parameter on right side of operation.

16 Answers 131 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.
Aaron Drenberg
Top achievements
Rank 1
Aaron Drenberg asked on 05 May 2010, 07:06 AM

Hello,

I'm using the Q1 2010 release of Open Access ORM. I'm trying to get all records from the database that match any primary key in an enumerable list. It keeps failing with the error: 'Must specify parameter on right side of operation.'

Here's the enumerable and the query

IEnumerable<Guid> idList

IQueryable<Item> query = from itm in ObjectScope.Extent<Item>() where idList.Any(id => id == itm.ItemId) select itm;

16 Answers, 1 is accepted

Sort by
0
Accepted
PetarP
Telerik team
answered on 10 May 2010, 10:41 AM
Hi Aaron Drenberg,

Unfortunately currently such types of queries are not supported. The only workaround I can provide you as for now is to rewrite your query in the following way:
IQueryable<Item> query = from itm in ObjectScope.Extent<Item>() where idList.Contains(itm.ItemId) select itm;


All the best,
Petar
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
Aaron Drenberg
Top achievements
Rank 1
answered on 11 May 2010, 01:46 AM
Your query statement works perfectly. Thanks for the reply.
0
Julie Gephart
Top achievements
Rank 1
answered on 01 Nov 2010, 08:07 PM
I think I might be running into the same issue, but I can't come up with another workaround. Can you confirm the issue and suggest?  I'm doing a "narrow your search" type of scenario where the user can enter multiple search terms, and the result must contain all the terms somewhere within selected fields.

from r in query
where searchTermsList.All(term =>
    (
        r.Title.Contains(term)
        || r.Description.Contains(term)
        || r.Component.Contains(term)
    )
) select r;
0
PetarP
Telerik team
answered on 04 Nov 2010, 07:35 PM
Hello Julie Gephart,

 Are you getting the same exception? Also is searchTermLists a collection of strings?
We look forward to your reply.

Best wishes,
Petar
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
Julie Gephart
Top achievements
Rank 1
answered on 04 Nov 2010, 07:38 PM
Yes, it's the same exception, and searchTermsList is a List<string> - sorry for not being more clear.
0
PetarP
Telerik team
answered on 11 Nov 2010, 03:02 PM
Hi Julie Gephart,

 Indeed queries like that are not yet supported. Unfortunately I am not able to provide you with a workaround other than iterating your words one by one.

All the best,
Petar
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
Tys
Top achievements
Rank 1
answered on 15 Apr 2012, 02:51 AM
Is this problem fixed by now? Or is there a good workaround?
I was trying to do something similar as Juli is doing.. but i'm also getting errors.
(Must specify parameter on right side of operation.)
0
Thomas
Telerik team
answered on 17 Apr 2012, 03:01 PM
Hello Tys,

please see this blog post for options and code that can be tweaked for your case.

Regards,
Thomas
the Telerik team
Share your passion about the Telerik Open Access by voting for Telerik's powerful ORM tool here >>
0
Tys
Top achievements
Rank 1
answered on 18 Apr 2012, 11:56 AM
Hi Thomas,
Thank you very much for your help / article! I guess this will help lots of people with their keyword/string search questions.
But, there is one thing, the last suggestion gives me an error as soon as i use more that one column:
An item with the same key has already been added.

I'm using the following piece of code:
query.MultiValueContainsAnyAll(queryParts, true, p => new[] { p.Name, p.Description});

Do you see what the problem might be? I'd be very happy if this can be fixed!

Best Regards, Tys
0
Thomas
Telerik team
answered on 18 Apr 2012, 05:18 PM
Hello Tys,

are you using the newest version? I made some tests with duplicate and many columns, not getting this issue. If you are seeing the issue with the newest version, please provide us with the complete LINQ query and the .rlinq that you are using as well as the complete stack trace.

Kind regards,
Thomas
the Telerik team
Share your passion about the Telerik Open Access by voting for Telerik's powerful ORM tool here >>
0
Tys
Top achievements
Rank 1
answered on 18 Apr 2012, 06:28 PM
Hello Thomas,
I'm using this code within a Sitefinity 4.4 project. And, as Sitefinity 4.4 uses OpenAccess 2011.2.713.3, i think i have to stick with that version.

Could this version be the problem?

And, is it true that i have to stick with that OpenAccess version, or are there ways to upgrade, so that both Sitefinity 4.4 and my project can use the latest version?

Kind regards, Tys
0
Thomas
Telerik team
answered on 23 Apr 2012, 08:42 AM
Hi Tys,

newer versions of OpenAccess do not show the mentioned issue. I think you would need to upgrade SF.

Greetings,
Thomas
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the OpenAccess ORM, subscribe to their blog feed now.
0
Tys
Top achievements
Rank 1
answered on 23 Apr 2012, 11:55 PM
Okay, that's good to hear, but like it said, i upgraded a Sifefinity install to 5 SP1, but i found that it doesn't use the latest version of OpenAccess.
Am i wrong? Or, can you tell me when Sitefinity will use the latest/without the mentioned bug, version of OpenAccess?

Kind regard, Tys
0
Thomas
Telerik team
answered on 24 Apr 2012, 02:45 PM

Hi Tys,

I cannot comment on the date when SF will use the newest version of OpenAccess. We are working on this ...

Greetings,

Thomas
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the OpenAccess ORM, subscribe to their blog feed now.
0
Tys
Top achievements
Rank 1
answered on 25 Apr 2012, 09:58 PM
But, perhaps some details about this part of the roadmap can be given?
It looks like there are many more people struggling with this issue...
0
Nikolay Datchev
Telerik team
answered on 03 May 2012, 08:13 AM
Hi Tys, the next official version of Sitefinity is planned for mid July. It will include the latest OpenAccess version.

Greetings,
Nikolay Datchev
the Telerik team
Follow @OpenAccessORM Twitter channel to get first the latest updates on new releases, tips and tricks and sneak peeks at our product labs!
Tags
LINQ (LINQ specific questions)
Asked by
Aaron Drenberg
Top achievements
Rank 1
Answers by
PetarP
Telerik team
Aaron Drenberg
Top achievements
Rank 1
Julie Gephart
Top achievements
Rank 1
Tys
Top achievements
Rank 1
Thomas
Telerik team
Nikolay Datchev
Telerik team
Share this question
or