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
|
We get the above error when using some linq thus: IQueryable<Depot> depots = Domain.GetDepots(); depots = depots.Where(d => d.Routes.Any(r => r.RouteName.ToUpper().StartsWith(filter.RouteName.ToUpper()))); however, this works ok: depots = depots.Where(d => d.Routes.Any(r => r.Id == filter.RouteId)); and I have other calls that use StartsWith just fine. Stack trace is: at Mindscape.LightSpeed.Linq.Translations.LikeMethodBase.Apply(QueryExpression applyTo, DataProvider provider, QueryExpression[] arguments)
Cheers |
|
|
Yes, unfortunately that is a known limitation with "Like" methods (in this case StartsWith translates to a LIKE function in SQL) being translated out of the LINQ provider, where if there is a traversal involved (in this case you have r.RouteName where r is a traversal of d.Routes) then it is not currently handled. This is on our backlog to be improved over the next period.
Jeremy |
|
|
Hi Jeremy, Can you elaborate on which sort of traversals are supported and whihc are not? I'm getting the same type of exception when trying to do something simpler from f# / Linq (Ignore the f# Linq syntax, just try to look at the traversal): This fails: let c = Database.CreateCatalogUnitOfWork() Where b.Author does the traversal to the author's table/entity. Natually doing the same without the "StartsWith" works, i.e.: let c = Database.CreateCatalogUnitOfWork() |
|
|
Hi guys, This limitation has now been removed and support will be available in nightly builds from tomorrow (20100106) onwards. Regarding the LINQ limitations, you can find details on the known limitations with the LINQ provider in the help file, or online at http://www.mindscape.co.nz/products/lightspeed/Help/Help%20Topics/LINQ/Limitations.html :)
Jeremy |
|
|
Definitely did the trick. I can now run the same f# Linq Query I posted before. Thanks! |
|