My project fails on my LINQ test to do the following:
// Create LINQ query for all customers who have placed more than ten orders
var result =
from customer in scope.Exctent<Customer>()
where customer.Orders.Count > 10
select customer;
Exception: {"Projecting collection fields not supported yet."}
I also tried "Count()" intstead of just "Count":
Exception: {"Not implemented: Execution of 'Enumerable.Count' on the database server side currently not implemented."}
This is a quite simple and common (i believe) query. Is this something you will implement in the near future?
Regards
Paul
5 Answers, 1 is accepted
the upcoming version does not have the issue. It should be available within 2 days.
Sincerely yours,
Thomas
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Downloaded the latest version, and one of my teo tests passed.
The "Count()" version still throws an exception:
{"Not implemented: Execution of 'Enumerable.Count' on the database server side currently not implemented."}
Still, half way there... :-)
Thanks.
Pål
you are right, there is an exception. However, the reason is because the type of the Orders property is IEnumerable<Order>. And IEnumerable<Order> does not have itself a Count() method, but one is provided as extension method from Enumerable.Count().
If you use ICollection<Order> type as property type for the Orders property, then the correct query is executed.
Greetings,
Thomas
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Hi Thomas,
I am trying to use contains (equivalent to IN clouse in sql) to filter my data, I am using oracle as backend insted of Sql Server. See my code below:
string
[] arrCode = new string[2];
arrCode[0] =
"AAA";
arrCode[1] =
"BBA";
var result = from c in scope.Secure<MtCurrency>()
where (c.CurrencyCode.Matches(searchText) || c.CurrencyDescription.Matches(searchText)) && arrCode.Contains(c.CurrencyCode.ToString())
select c;
When I test this code in WebOrb, I got error:
"Execution of 'System.Linq.Enumerable:Contains' on the database server side currently not implemented"
Please suggest me where I am wrong ? If I run this query without using contains then its working fine.
Regards,
Devanand Chahal
CPA Global
this is an issue with the detection of the System.Linq.Enumerable:Contains method. If you use a List<string> instead of the string[] for the arrCode, everything should work.
We will try to fix that as soon as possible.
Kind regards,
Thomas
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.