System.NotSupportedException

2 posts, 0 answers
  1. Bob
    Bob avatar
    46 posts
    Member since:
    Apr 2012

    Posted 24 Sep 2014 Link to this post

    We are running version 2013.3.1014.1 and need to retrieve data based on an array of keywords so our LINQ code looks like the following:

                    var keywordsArray = new string[] { "keyword1", "keyword2", "keyword3" };
                    var qry = from q in ctx.Quotes
                              join qp in ctx.QuotePages on q.QuoteId equals qp.QuoteId
                              join qi in ctx.QuoteItems on qp.QuotePageId equals qi.QuotePageId
                              where q.Customer.CustomerNumber == 7101140 &&
                              qi.Active.Value && keywordsArray.Any(kw => qi.Sku.Contains(kw))
                              select q;

    However, when the query is run, it returns the following System.NotSupportedException error:
    Execution of 'System.Linq.Enumerable:Any(IEnumerable`1,Func`2)' on the database server side currently not implemented.

    This seems like a query that should be supported by Open Access and is in fact supported by MS EF.

    Is "Any" already supported in a later version or is being planned?

    Thank You
    Bob Baldwin
    Trabon
    816-276-2512
  2. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 25 Sep 2014 Link to this post

    Hello Bob,

    I think for your case you can find a solution here in the blog post: String Matching
    To provide general support for Enumerable:Any(condition) is really a bigger task, but with the code mentioned in the post the multi-parameter-string-contains is doable.

    Regards,
    Thomas
    Telerik
     
    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
     
  3. DevCraft banner
Back to Top