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
|
I am getting a ""Property 'Int32 ElementId' is not defined for type 'System.Int32'" error when trying to evaluate the following LINQ query. The session class simply returns a strongly typed unit of work. The ElementId column in all records in the database does have a valid integer value.
Dim elms = From p In session.UnitOfWork.Pieces _
For Each elm In elms The error occurs when trying to iterate through the For Each. If I take the Group By off I can iterate just fine. Help! The stack trace is at System.Linq.Expressions.Expression.Property(Expression expression, PropertyInfo property) at System.Linq.Expressions.Expression.MakeMemberAccess(Expression expression, MemberInfo member) at Mindscape.LightSpeed.Linq.Plan.GroupResultsPlan.GetCandidateGroupMembers(IUnitOfWork unitOfWork, String groupingAttribute) at Mindscape.LightSpeed.Linq.Plan.GroupResultsPlan.GetAllGroupsAtOnce(IUnitOfWork unitOfWork, IList groupingKeys, IList interimKeys, IAttributePathExpression groupingOn, GroupResultsTypeHandler handler) at Mindscape.LightSpeed.Linq.Plan.GroupResultsPlan.FetchResultSetForSingleGroupingKey(IUnitOfWork unitOfWork, IList groupingKeys, IList interimKeys, GroupResultsTypeHandler handler) at Mindscape.LightSpeed.Linq.Plan.GroupResultsPlan.ExecuteImmediate(IUnitOfWork unitOfWork, Type returnType) at Mindscape.LightSpeed.Linq.LinqQueryProvider.Execute(Expression expression) at Mindscape.LightSpeed.Linq.LinqQueryProvider.System.Linq.IQueryProvider.Execute(Expression expression) at Mindscape.LightSpeed.Linq.LinqQuery`1.GetEnumerator() at System.Linq.SystemCore_EnumerableDebugView`1.get_Items()" |
|
|
Hi Steve, This was tripping up on an previously unhandled overload for GroupBy which VB.NET seems to use when grouping with an alias but no specific selection but not in the other cases we currently test against. I have added in a check to cover for this and it will be available in tonights nightly build (20100720) and later. Thanks for bringing this to our attention!
Jeremy |
|
|
That solved the problem. I hope you double checked all the other possible overloads that VB might use. I lost a few days because I'm a LINQ newbie and assumed I was the problem rather than Lightspeed. Thanks Steve |
|