[] .dbo. [] with key 0 has not been updated
I am trying to update an entity but I get the error, [] .dbo. [] with key 0 has not been updated follows the oml below, I am assigning the id correctly.
Hi Fabiano,
You are trying to update a record with Id = 0, in other words, you're trying to update a record which does not exist.
In the CarrinhoUpdate action, you need to make sure the Carrinho.Id is filled in:
Since you know best the logic you want to implement, it should be easy for you to know make sure you fill the Carrinho.Id correctly.
Kind Regards,João
I didn't realize that the Cart was going null, in vdd I was controlling with ProductId, anyway I ended up having a problem using the logic of createUpdate and UpdateI solved the problem by putting a logic only, because this is going to be duplicated too
For knowledge, you can also create an object as an input parameter.
In this way, when adding new fields to your table [Carrinho], it is not necessary to create these fields as Action(CarrinhoUpdate) input parameters:
Regards.
I used his solution, not least because it generated duplicate results