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 use shared unitOfWork and I need to ask you what will be with entity of Lightspeed when I launch unitOfWork.Remove() in part of code CATCH (for example in false validation) Sample: |
|
|
Hi Janis, Calling UnitOfWork.Remove() will only mark the entity as deleted. Calling SaveChanges again will actually delete the entity from the database. Use: catch I hope that helps, John-Daniel |
|
|
Hi John-Daniel,
Idon´t want this thing,
I wan´t another - in block of CATCH code I need lever out the entity from unitOfWork, but not lever out it from database. In block TRY code it makes a validation of entity and when it is right then the update of entity will realize and SaveChange(). If the validation of entity is not right, than the Exception is invoke and the CATCH code will block in whitch I need remove the entity from unitOfWork
to unitOfWork could be clear for next update.
|
|
|
Hi Janis, Sounds like you want a method unitofWork.Ignore(Entity entity) - which would unregister the entity from the unit of work? If so, this is not something which is available publicly at the current time, but we would be open to looking at this given the right reasoning :) In what you are saying above, you want to remove the entity so your unit of work can be saved at a later point without running in to the same error? How are you currently scoping your unit of work? Is it Per Request as part of a web application or more long running?
Jeremy |
|