如果我只点击更新按钮,则 context.SaveChanges() 返回 0。如果我不做任何更改而只是点击更新按钮,它会返回 0。我正在检查 SaveChanges 返回的值。SaveChanges 返回 0 的条件是什么。返回值表示什么?
以下是我的代码。
int returnValue = CS.SaveChanges();
return returnValue == 1 ? "User profile has been updated successfully" : "Unable to update";
Run Code Online (Sandbox Code Playgroud)