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 am using Breeze at client side. Breeze posts a bundle of Json objects to server for save. The objects may be created, updated, or deleted. Breeze server-side code takes care of deserialization of the Json objects. However, I cannot add deserialized entities to UnitOfWork. For example, the EntityState of a deserialized new object is Default, not New. If I added the entity to UoW, UoW would reject it, complaining that required EntityState is New. EntityState is read only. So I cannot change it to New. How to deserialize Json objects as savable entities? |
|
|
Use UnitOfWork.Import rather than Attach as this will check if the entity already exists (based on the Id) and merge it with the existing entity or mark it as new accordingly.
|
|