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

System.NotSupportedException

1 Answer 82 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.
Bob
Top achievements
Rank 1
Bob asked on 24 Sep 2014, 12:40 PM
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

1 Answer, 1 is accepted

Sort by
0
Thomas
Telerik team
answered on 25 Sep 2014, 09:33 AM
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.
 
Tags
LINQ (LINQ specific questions)
Asked by
Bob
Top achievements
Rank 1
Answers by
Thomas
Telerik team
Share this question
or