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
|
Well, we are about to take the leap next week and upgrade to 3.0 I have reviewed the ChangeLog, and there are was one thing that does not look backwards compatible: Renamed FindOne(object) overload to FindById Are there any other cadveats that we should be aware of? Thanks, -Joe
|
|
|
I've had a blog post lined up on this very subject and this seems the ideal moment to release it! http://www.mindscape.co.nz/blog/index.php/2009/12/17/moving-from-lightspeed-2-to-lightspeed-3/ We believe these should be the only compatibility concerns. |
|
|
perfect timing! thanks...
|
|
|
There's the datacontract serialization breaking change mention in my other thread. Also LS3 linq doesn't seem to support invocationexpressions, or at least I had to rewrite a bunch of our code that builds queries to not use Expression.Invoke to make it work with LS3. |
|
|
Hi Luke, Would you be able to provide us with an example of Expression.Invoke that worked on LightSpeed 2.x but fails on LightSpeed 3? Thanks! |
|
|
We have expression extension helper methods like these
public static Expression<Func<T, bool>> Or<T>(this Expression<Func<T, bool>> expr1, Expression<Func<T, bool>> expr2) { var invokedExpr = Expression.Invoke(expr2, expr1.Parameters.Cast<Expression>()); return Expression.Lambda<Func<T, bool>>(Expression.OrElse(expr1.Body, invokedExpr), expr1.Parameters); }
public static Expression<Func<T, bool>> ValueEquals<T, TValue>(Expression<Func<T, TValue>> expression, TValue value) { var x = Expression.Parameter(typeof(T), "x"); var binEx = Expression.Equal(Expression.Invoke(expression, x), Expression.Constant(value)); return Expression.Lambda<Func<T, bool>>(binEx, x); } Those work with LS2 but not LS3. I got them to work with LS3 by not using .Invoke and doing a whole parameter-copy-with-a-tree-visitor thing. |
|