This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi Chaps, I'm having problems trying to do a simple group by using version 3.1. I tried the below code but got a "This overload of method 'GroupBy' has no supported translation in LightSpeed. " error. Dim unallocated = _
(From referral In _uow.FraudReferrals
Group referral By referral.ReportId Into g = Group
Select New With {ReportId, g.Count})
I also tried the below and also got a "This overload of method 'GroupBy' has no supported translation in LightSpeed." error.
Dim myReferrals = _ From referral In _uow.FraudReferrals
Group referral By referral.ReportId Into g = Group Select g I'd appriciate any help you could give me, its really frustrating! Thanks |
|
|
Hello Oliver, This issue appears to be to do with the different ways Visual Basic and C# handle LINQ grouping keywords. It looks like we're not handling the VB grouping expressions correctly. I've passed this on to a colleague for further investigation, but he's overseas at the moment so this may not be a quick fix. As a workaround, you can rewrite your queries using the query operators instead of the Visual Basic wrapper syntax: Dim query1 = _uow.FraudReferrals.GroupBy(Function(r) r.ReportId) Note that, as hinted in the second query declaration, these return results in a slightly different way from the VB Group Into keywords: you will get an IGrouping object, which has a Key property containing (in your case) the ReportId which is the group key, and which is IEnumerable<FraudReferral> for enumerating the members of the group. Thanks for drawing our attention to this issue! |
|
|
Hello Oliver, Just to let you know that the latest nightly build (22 June) contains a fix for Visual Basic Group By support which should allow you to go back to using the syntax instead of the extension methods. Let us know if you still see problems! |
|