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 there, I am currently experiencing an issue in Lightspeed where if a UnitOfWork is:
When I declare my UnitOfWork, it is using this code (via Ninject):
And is called when I do this:
My confusion is, when the SaveChanges() method gets called, the insert statement that needs to get executed does not fire at all. I have also checked my code and majority of the SaveChanges() are all implicit. Was wondering if there are others who have encountered this issue, and if so, what would be the workaround? Thank you! Cheers, Ann |
|
|
Hi Ann, Can you check if myNewObject.UnitOfWork is the same object as UnitOfWork, and if you enumerate the UnitOfWork (which will return the list of entities in its identity map) that myNewObject is in that set. Also just prior to the SaveChanges() call is myNewObject.EntityState set as EntityState.Default (it should have this value assigned automatically from instantiation). Lastly are you implementing any hooks for events such as Entity.Saving?
|
|