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, I have read in the forum that LS cannot load soft-deleted entities when doing an association load. However, consider that the "logic" behind soft-deletion is that a business object (like a Customer) has been phased out, but old Orders still refer to this Customer. This means that when you "directly" load a Customer, you shouldn't get those that have been soft-deleted (unless explicitly directed to) But, when you load an Order and then refer to Order.Customer, it makes sense to get the soft-deleted Customer. With this in mind, I am wondering whether it would make sense to have some sort of "global" flag that says "Load soft-deleted Associations"? In my application (an MVC4 WebAPI) I use DTOs to pass objects up/down the wire. I also use AutoMapper to not only map properties, but to also Ignore certain properties. This has worked beautifully with LS ability to load by reference (using dot notation) e.g: Order.Customer Only hiccup is when the reference is a soft-deleted entity. What would you suggest as the best way to work-around this limitation? Thanks - Imtiaz |
|
|
If you need to load soft deleted entities you can explicitly opt in to this as part of your query (e.g. http://www.mindscapehq.com/documentation/lightspeed/Implementing-Storage-Policies-with-LightSpeed/Soft-Deletion). We leave it to you as to how you want to handle these since its really a per app concern. In terms of the scenario you described, surely if the associated Customer entity is deleted you should ignore any mapping for it since there isn't a customer. Or alternatively just load it with IncludeDeleted on for that particular concern. Or am I misunderstanding the scenario?
|
|