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
|
I have a use case where a user can add multiple detail records, if one of the data items do not exist in the lookup table, we add it and set the value, we are running into an issue with subsequent detail records that use that same data item; is there a way to include new items in the UnitOfWork to the results of a query? |
|
|
Hi Akesh, It's not built in, however you could add the items manually as needed. You can always iterate the entities on the unit of work that are pending a SaveChanges call like so: unitOfWork.Where(e => e.EntityState == EntityState.New) Of course, you can test other properties & the type information, and then add them. I'd recommend perhaps creating a simple extension method to wrap this up in. I hope that helps, John-Daniel Trask |
|