New Posts New Posts RSS Feed: Delete not loaded entity. Possible?
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Delete not loaded entity. Possible?

 Post Reply Post Reply
Author
katit View Drop Down
Senior Member
Senior Member


Joined: 09-Sep-2011
Posts: 146
Post Options Post Options   Quote katit Quote  Post ReplyReply Direct Link To This Post Topic: Delete not loaded entity. Possible?
    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?
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 19-Oct-2012 at 12:10pm
Hi Katit,
 
I suggest you set a cascading delete.
 
Regards,
   sbelini.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down