Error - Must specify parameter on right side of operation.

17 posts, 1 answers
  1. Aaron Drenberg
    Aaron Drenberg avatar
    7 posts
    Member since:
    Jan 2010

    Posted 05 May 2010 Link to this post


    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;
  2. Answer
    PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 10 May 2010 Link to this post

    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.
  3. DevCraft banner
  4. Aaron Drenberg
    Aaron Drenberg avatar
    7 posts
    Member since:
    Jan 2010

    Posted 10 May 2010 Link to this post

    Your query statement works perfectly. Thanks for the reply.
  5. Julie Gephart
    Julie Gephart avatar
    24 posts
    Member since:
    Feb 2007

    Posted 01 Nov 2010 Link to this post

    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;
  6. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 04 Nov 2010 Link to this post

    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
  7. Julie Gephart
    Julie Gephart avatar
    24 posts
    Member since:
    Feb 2007

    Posted 04 Nov 2010 Link to this post

    Yes, it's the same exception, and searchTermsList is a List<string> - sorry for not being more clear.
  8. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 11 Nov 2010 Link to this post

    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
  9. Tys
    Tys avatar
    14 posts
    Member since:
    Jul 2011

    Posted 14 Apr 2012 Link to this post

    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.)
  10. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 17 Apr 2012 Link to this post

    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 >>
  11. Tys
    Tys avatar
    14 posts
    Member since:
    Jul 2011

    Posted 18 Apr 2012 Link to this post

    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
  12. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 18 Apr 2012 Link to this post

    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 >>
  13. Tys
    Tys avatar
    14 posts
    Member since:
    Jul 2011

    Posted 18 Apr 2012 Link to this post

    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
  14. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 23 Apr 2012 Link to this post

    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.
  15. Tys
    Tys avatar
    14 posts
    Member since:
    Jul 2011

    Posted 23 Apr 2012 Link to this post

    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
  16. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 24 Apr 2012 Link to this post

    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.
  17. Tys
    Tys avatar
    14 posts
    Member since:
    Jul 2011

    Posted 25 Apr 2012 Link to this post

    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...
  18. Nikolay Datchev
    Admin
    Nikolay Datchev avatar
    2 posts

    Posted 03 May 2012 Link to this post

    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!
Back to Top
DevCraft banner