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
|
When i try to execute LINQ query like following: List<Order> orders = dataUnitOfWork.Orders.Where(order => (DateTime.Now - order.LastDate.Value).Days > order.Period).ToList();
i get exception:
at . . (IdentifierExpression , FieldModel& , ToOneModel& , \b& , String& ) at . . (IdentifierExpression , FieldModel& , ToOneModel& , \b& , String& ) at . . (IdentifierExpression ) at Mindscape.LightSpeed.Querying.IdentifierExpression. [T]( ) at . . (PredicateExpression ) at Mindscape.LightSpeed.Querying.PredicateExpression. [T]( ) at . . (LiftedPathExpression ) at Mindscape.LightSpeed.Querying.LiftedPathExpression. [T]( ) at . . (LogicalExpression ) at Mindscape.LightSpeed.Querying.LogicalExpression. [T]( ) at . . (AliasedTypeModel , QueryExpression , Order , Group , String , Boolean , Boolean ) at . . (LightSpeedContext , List`1 , QueryExpression , Order , Group , String , Boolean , Boolean ) at . . (List`1 , Query , String , IdentifierExpression ) at . . (AliasedTypeModel , Query , String , IdentifierExpression ) at . . (AliasedTypeModel , Query ) at . . (TypeModel , Query , IList ) at . . (UnitOfWorkBase , TypeModel , Query , IList ) at . . (Query , TypeModel , IList ) at . . (Query , IList ) at Mindscape.LightSpeed.UnitOfWork.Find(Query query, IList results) at Mindscape.LightSpeed.UnitOfWorkBase.Find(Query query) at Mindscape.LightSpeed.Linq.Plan.SingleQueryPlan.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.Collections.Generic.List`1..ctor(IEnumerable`1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
|
|
|
This part "(DateTime.Now - order.LastDate.Value).Days" will not be able to be translated by the LINQ provider currently. I will pop a ticket on our backlog to have a look at this and see if we can make some improvements here, however you should still be able to express this using the LightSpeed querying API as something like this (assuming SQL Server as the provider): var q = new Query();
Jeremy |
|
|
I ran into a similar issue. Should this issue be fixed by now? |
|
|
No this is still currently outstanding, but I will having another look at this again shortly. Will keep you posted.
|
|