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
|
When executing a unit of work.Find it only looks for items that have been persisted to the storage. Is there anyway to find objects that are new/in memory only? |
|
|
Unfortunately you need to look for new objects separately. The easiest way to do this is to use LINQ to Objects over the unit of work itself: unitOfWork.OfType<Widget>().Where(w => w.Size > 10); (UnitOfWork implements IEnumerable<Entity> so this operates over all entities loaded into the UOW.) |
|
|
If you intend to combine this with the results of a Find() or LINQ to LightSpeed query, you may want to fold in a Where(e => e.EntityState == EntityState.New) to avoid existing entities appearing twice in the result set. |
|