Database operation expected to affect

Database operation expected to affect 1 row(s) but actually affected 0 row(s) In EF Core, there is a rule that is not obvious about setting the primary key on child entities and adding it to the parent when the parent entity has already been saved (or retrieved from the context). When creating a parent entity that is not saved, when you add a child entity where you are manually setting the primary key, you will not see this behavior.
Read full post gblog_arrow_right