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
|
Is there a way to detach the created objects from the unit of work. I have a single unit of that is active for the entire life of my application (a desktop app with exclusive access to the database). I need to create sono objects that I don't want to attached to the database. They are created in a dialog form and need to be discarded if the user cancels the selection. Is there a way to created detached objects directly? I have a one to many relationship between objects. Thanks. |
|
|
Hi Nagar, There is a Detach(entity) method on the UnitOfWork. What would likely make more sense though is to create the entity and if it's not used just throw it away. If they accept the changes then attach it and save. An entity is not connected to a unit of work until you .Add() it, .Attach() it or setup a relationship to a UoW connected entity.
John-Daniel |
|