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
|
I use the following code to turn a generic DSL into a lightspeed specific query.
Hopefully, you can see from here the features I am using inside the Lightspeed DSL. I then materialise the query by calling UnitOfWork.Project This is the exception that is thrown
EDIT: We are using Lightspeed 4.0.1466.20917 |
|
|
UPDATE: Same result using the nightly 4.0.1712.21984 Also - I note that the IL offsets are the same. (If that helps at all) |
|
|
Poking at this with a stick now. What does "Entity type is not registered with the type map so we cannot infer the alias name" mean? |
|
|
Is it possible for you to send through a small repro of this? If you can just pare it back to just your model (or subset of) and a single query that would be ideal. If not can you detail what your Query object looks like prior to making the .Project call so we can try and reproduce this here. Clearly something is a bit off here but its not entirely evident what that might be since there are a few places in the method in question where something could trigger a NullReferenceException. That error message is raised when the entity type for a projection field has not been registered in the .Mappings prior to you adding a projection field into the projection collection. It typically will occur if you create a Query and dont set the EntityType.
|
|
|
It would appear that in building the reproduction, it is introducing the paging parameters that causes the NullReferenceException. I will let you know if I can get a trivial repro without the solution baggage. |
|
|
Here is a repro for the issue. It appears that the ClassTableInheritance is the root cause (as usual). Hopefully this will help you track down the issue. Cheers, Andy Note: Here is a simplest version of the test that exhibits the behaviour
|
|
|
Thanks for that! That helped to quickly identify the offending code and I have added a fix for this and this will be available in the next nightly build for you. Let us know how you get on with this after installing the updated build.
|
|
|
Hi The new nightly fixes the projection problem. Thanks for that. Just FYI, when issuing
I worked around this by removing the projection before doing any counts, so no worries here. |
|