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
|
In upgrading Lightspeed where we are using class table inheritance and soft deletes when performing the delete an SqlException is thrown with the message "The multi-part identifier "Foo.Id" could not be bound.". The sub table's delete statement is referencing the parent's table name. Attached is a console to reproduce the error. |
|
|
Thanks for the concise repro - You have soft delete set at both levels of the inheritance chain. As it is set on the base it is not required on the derived table. When deleting a derived instance the soft delete field will be marked on the Foo instance, which will prevent any furthor loads of the FooBar instance since it will join on Foo when loading. If you remove the SoftDelete setting from FooBar then that will resolve this issue, let us know if there are any furthor issues you notice when upgrading your actual model.
Jeremy |
|
|
Thanks Jeremy. This resolves my issue in the repro, however my actual application is using a slightly different method to delete as it is in the base repository and we may not have an instance of the entity. If you replace the following lines unitOfWork.Remove(foobar); with these in the repro (after setting Soft Delete = false on FooBar in the model) we see a similar exception. Our base repository is generic so typeof(Foo) is replacedwith typeof(T) in the real world. var query = new Query(typeof(Foo)) { Identifier = foobar.Id };
|
|
|
Thanks for the update - I can replicate the same behavior you are seeing. Ill post an update once we have made progress towards a fix on this.
Jeremy |
|
|
We are including a candidate fix for this issue into tonights nightly builds (20110329), it resolves the repro case - please let us know how this goes with your actual cases.
Jeremy |
|