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, I tried to use this library: http://www.albahari.com/nutshell/predicatebuilder.aspx When he deferred execution happens I got this message "This expression type is not supported in LightSpeed 3.0" Here are the steps to repro:
IQueryable<Customer> custs = new Customer().SearchCustomers("Joe", "Blog"); ...
public IQueryable<Customer> SearchCustomers(string firstName, string lastName) { var predicateBuilder = PredicateBuilder.False<Customer>(); LightSpeedContext<AppTier.ModelUnitOfWork> _context = new LightSpeedContext<AppTier.ModelUnitOfWork>("Development"); _context.Logger = new Mindscape.LightSpeed.Logging.TraceLogger(); using (var unitOfWork = _context.CreateUnitOfWork()) { predicateBuilder = predicateBuilder.Or(c => c.FirstName.Contains(firstName)); predicateBuilder = predicateBuilder.Or(c => c.LastName.Contains(lastName)); return unitOfWork.Customers.Where(predicateBuilder); } }
Could you take a look at this for me and let me know if its something that you can fix? The problem is in the LightSpeed.Lin.dll, something about: 'Anonymously Hosted DynamicMethods Assembly' Cheers, |
|
|
Hi Jeremy, We are up at TechEd NZ currently, but I will try and have a look at this today if possible and provide some feedback on this :)
Jeremy |
|
|
Hi Jeremy, Back from TechEd now, and I noticed Ivan has actually already looked into this type of thing before. The problem stems from the use of Expression.Invoke in Joes default PredicateBuilder implementation, if you have a look at this post: http://www.mindscape.co.nz/forums/Post.aspx?ThreadID=3232&PostID=10722 you can make a fairly simple change to remove Expression.Invoke from the And/Or methods which removes the unsupported aspect from the query.
Jeremy |
|
|
Hi, Awesome, its already fixed! Cheers, ps I'm sure you guys rocked TechEd NZ:)
|
|