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
|
Scenario: I have in my model a User Defined Type of PartyType. PartyType has a special TypeConverter defined which converts a varchar value to/from an enum value. That converter works most of the time when I query through the in Lightspeed LINQ manner. e.g.
But if I try to do the same thing using the FindBySql method, e.g.
it has a problem converting the varchar value PartyType. The exact error I get is IndexOutOfRangeException .Type |
|
|
Is this reproducible from the earlier repro project you sent through? Ive tried executing this against the model in that project but it ran fine for me but I couldn't see that PartyTypeConverter was actually being used.
|
|
|
I have tried to make a sample that reproduces it, but struggled. My unit tests pass, it fails in integration tests. The Stack Trace from the exception is:
You can see it was inside SatisfiesDerivedTypeModelDiscriminator when it fell over which is what led me to assume it was tripping up on the string Discriminator. |
|
|
Ah right. The problem will be because Type is defined on the base entity (correct?) and you are not joining against that table in your SQL statement so the column doesn't existing in the result set leading to the exception.
|
|
|
Boom! I just arrived at the same conclusion and was about to write an update. ;) Yeah I was doing exactly that. So now i'm joining to the base class table and all is sweet. So now I can Pop one problem off the stack and return to http://www.mindscapehq.com/forums/thread/1086771 |
|