Print Page | Close Window

Delete not loaded entity. Possible?

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3727
Printed Date: 08-Jun-2025 at 3:24am


Topic: Delete not loaded entity. Possible?
Posted By: katit
Subject: Delete not loaded entity. Possible?
Date Posted: 18-Oct-2012 at 4:41pm
I have table structure where I have 1 to 1 relationship (Document-File) in which File has blob and I load it only when needed/lazy load.
 
To delete entity I need to run following:
1. File.EntityAspect.Delete()
2. EntityManager.SaveAsync()
 
So, to delete Document and File I need to load both entities. Generated SQL doesn't need all the data, it runs deletion by Document.FileKey anyway..
 
Anyway to skip loading File entity if I just want to delete?



Replies:
Posted By: sbelini
Date Posted: 19-Oct-2012 at 12:10pm
Hi Katit,
 
I suggest you set a cascading delete.
 
Regards,
   sbelini.



Print Page | Close Window