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
|
When performing eager loading on an aggregate, referential integrity can sometimes fail, what we receive back is a generic error along the lines of Key not found. Is there a way to get a more specific error message that enables us to identify the data that caused the exception and the precise relationship that failed. We are on lightspeed 3.11. |
|
|
This isn't currently available but I'll add it to the wishlist. If you can provide us with the stack trace of where the generic error is being thrown, that would help us to identify where we should add the extra detail (and whether it will be possible to do so). Please note that if we are able to make this enhancement it will be in LightSpeed 4 and we would not plan to backport it to 3.x. |
|
|
Thanks for looking into this, the stack trace is below, if you need anything else, please let me know. ---------------------------------------- |
|
|
I saw a previous forum, which may address the issue by overriding the default error message for a relationship using the field : "Presence Validation Custom Mesaage" which is available under the properties of the relationship. Unfortunately I cannot find enough doco and I'm struggling to get it work to work in my test cases. Could you please confirm if this function does override the default error message and how I can get it working. I have noticed you have posted the something on a similiar topic below, I've tried this, but to no avail. Any thoughts ???
Cheers Mark "No worries. The next nightly build will have a "Presence Validation Custom Message" property (on one-to-many associations only, not one-to-one). If you have any hand-coded associations that need this, apply the following to the EntityHolder field: [Validate(typeof(PresenceAssociationValidationRule), "Oh noes!")] Let us know if you run into any problems. Also let us know if you want it backported to 2.x -- we enjoy a good laugh. " |
|
|
Yes, that option does override the default error message if the association is not present. There isn't really a lot to document: select the association arrow and enter the desired error message. You should then see the error message during validation. What issue are you having? Validation not firing? Default error message being shown? Do you have a simple test case (NUnit test or console application) that exhibits the problem? |
|