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 This query works: var r = (from ma in UnitOfWork.MediaAssets But this one breaks: var r = (from ma in UnitOfWork.MediaAssets The only difference is the first one selects an anonymous object, the second one selects a strongly typed result (MediaAssetSetItemSummary).
Here's the error: System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation. |
|
|
I found another bug. When joining on two variables in LINQ and one of those variables is a constant then an error is thrown: Guid d = Guid.NewGuid();
The error: System.NullReferenceException : Object reference not set to an instance of an object. |
|
|
Hi James, We have added in a fix for the original issue around the error occuring when projecting to a strongly typed result. This will be available in the next nightly build.
Jeremy |
|
|
For the issue you are seeing with joining on constants, currently this is not supported. Only joins between entity properties (which ultimately will map to database columns) are supported. The error message here could most definitely be a bit clearer about that so Ill look at adding some better checks to handle that. That said, I am keen to extend support to include constants but this is not something that will be quick to implement. Im going to have a look at this over the next few days to see if we can get this in, will keep you posted.
Jeremy |
|
|
Ok. This isn't that important, I might rewrite it as a SQL stored proc. Figured you would want to know about the bugs I found along the way. |
|
|
Hi again I've found some places where I need to use a constant in a join. Could you look into this and let me know when it could be added? I'd rather use LINQ than make stored procedures each time. |
|