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 guys, I am trying to load a read-only view which includes soft deleted entities. Within the query below, the receiver's address (Child Entity of Consignment) has been soft deleted by the user, but when trying to load a consignment by id the search fails Can you point me in the right direction with this. Cheers result = (from consignment in uow.Consignments.IncludeDeleted |
|
|
If you attach a logger what is the SQL you are seeing generated for this query? Also just to confirm, all of the entities are accessed as tables rather than being database views?
|
|
|
Jeremy, Thankyou for your quick reply. below is the trace logger info for the above query. It is definitley not including deleted records SELECT t0.Id AS [t0.Id], t1.AccountName AS [t1.AccountName], t0.Connote AS [t0.Connote], t0.ConsignmentDate AS [t0.ConsignmentDate], t0.Reference AS [t0.Reference], t3.CompanyName AS [t3.CompanyName], t2.CompanyName AS [t2.CompanyName], t0.DeletedOn AS [t0.DeletedOn] FROM Consignment t0 INNER JOIN Account t1 ON t0.AccountId = t1.Id AND t1.DeletedOn IS NULL INNER JOIN Address t2 ON t0.SenderId = t2.Id AND t2.DeletedOn IS NULL INNER JOIN Address t3 ON t0.ReceiverId = t3.Id AND t3.DeletedOn IS NULL WHERE t0.Id = 88203 I am accessing these directly through tables via the unit of work. The version i am using is 5.0.2442 Cheers and thank you again. |
|
|
Hi, Just wondering if there has been a solution found for this. Cheers guys. Mike. |
|
|
No we have not been able to look at this yet - its still on the outstanding work list though so Ill post an update once we have made some progress.
|
|
|
Ok thankyou, is there a timeframe on looking into this?? or is there an alternative to use the QueryObject and project results from the above query to a new object??? |
|
|
Sorry we dont have any timeframe on when this will be reviewed. You can certainly look at loading the child entities manually using the querying API (or LINQ) but you would need to approach the query with the Address as being the primary entity as the IncludeDeleted flag is only applied to the root entity in the query. e.g. Address join Consignment where ConsignmentId = [id]
|
|
|
I wouldn't hold your breath, Mike. There is still this outstanding issue related to soft deletes http://www.mindscapehq.com/forums/thread/2344012 Unfortunately there doesn't seem to be much interest in fixing soft delete related bugs. |
|