I am trying following code, it has two parts, one is navigation via prism. When navigation is allowed I am starting a deep load asynchronously but each time with a new conte
The problem is this code :
_unitOfWork = _UnitOfWorkFactory.createUnitOfWorkAsync();
IEnumerable relaties = await getRelatieAsync(_unitOfWork, relatieId).ConfigureAwait(true);
_relatieTypeTypes = await getRelatieTypeTypesAsync(_unitOfWork, relatieId).ConfigureAwait(true);
_relatie = relaties.FirstOrDefault();
_unitOfWork.Dispose();
the UnitOfWork is an instance variable, when the scenario starts a second time it is overwritten with a new instance. The already executing scenario then uses that new UnitOfWork instead of its own because it is overwritten. Not so easy to spot, but a simple race condition. I found it by replacing all instance variables by local variables and then the problem disappeared.