So, is it possible for me to look at the execution order of Querys
that Entity Framework
mounts?
My problem is that it is trying to make a deletion in the wrong order, even after I make the calls in the order that sql server works.
Code:
itensPVF.ForEach(e => this.pvfService.RemoverPorChave(e.Chave));
RemoverItemSolicitado(chaveOS, numeroItensPvf);
In this case, this itemPVF
has to be erased first because of its relationship with the table that is deleted in sequence, only at the time of commit
by entity
, it does not understand in this way and it error :
{"The DELETE statement conflicted with the REFERENCE constraint \"FK_TB_ITEM_OS_PVF_TB_ITEM_SOLICITADO\". The conflict occurred in database \"BANCO\", table \ "dbo.TB_ITEM_OS_PVF\", column 'CD_ITEM_SOLICITADO'. \r\nThe statement has been terminated."}