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
|
Suppose i have following code: using (UnitOfWork unitOfWork = context.CreateUnitOfWork()) { var data = unitOfWork.TestEntities.ToList(); // getting initial data // data.Field1 == "InitialValue" here data.Field1 = "PendingValue"; // setting temporary pending value // data.Field1 == "PendingValue" here //Question: How can i get data with data.Field1 == "InitialValue" or with data.Field1 value from database? } related post: Stored Procedure and UnitOfWork entity cache |
|
|
You can't currently reload values from the database into an existing entity. Depending on what you're trying to achieve, there are a couple of things you can do instead: 1. If you're trying to get the original values for reference, you can create a new unit of work and load the same record into that. The new unit of work will get a fresh copy of the record. 2. If you're trying to reset the entity to an earlier state, for example as the result of user cancellation, use the BeginEdit method to mark the beginning of a set of tentative changes, then the CancelEdit method to undo the changes (or EndEdit to confirm them). |
|