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 firstname.lastname@example.org
Lightspeed version: 5.0.2302.0
UPDATE: It does seem like something is up with the DriverAppUnitOfWork, I created a new entity just for the purposes of deleting it and I still go the exception. More details on the DriverAppUnitOfWork below
Although the error seems like there is something wrong with the DriverAppUnitOfWork, it's actually ok - the problem is with the entity.
I have a "person" entity that I get in a UnitOfWork like this:
Where Code.Get.Uow basically just gets a context and returns context.CreateUnitOfWork()
Then later in the code I have another UnitOfWork where I attach the person and try and delete them:
I have tried adding a uow.Detach(person) in the first uow but that doesn't do anything.
I've checked the uow IdentityMap and the person object is definitely in there, so I don't understand why it's saying it is disposed.
Is it because I got it off a device entity in the first place?
If I check the person entity when the exception is thrown I can see that it has been marked as Deleted.
Some more info on how I'm getting a UoW, it's worked fine for me so far for reading and updating data. It doesn't like this Remove though. Is it something to do with using this same static method more than once?
I'm using Web API (so no per request scope available) and here is the code I'm using to create the uow: