From e081656003ff6d52ffa020033eb9a016ae4ba0cf Mon Sep 17 00:00:00 2001 From: Liam Cottrell Date: Fri, 14 Jun 2019 12:39:50 +0100 Subject: [PATCH] Updated Documentation to Reflect Changes in #11696 (#12877) --- aspnetcore/data/ef-mvc/concurrency.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/data/ef-mvc/concurrency.md b/aspnetcore/data/ef-mvc/concurrency.md index 220b3b4c28..8621e8b874 100644 --- a/aspnetcore/data/ef-mvc/concurrency.md +++ b/aspnetcore/data/ef-mvc/concurrency.md @@ -149,7 +149,7 @@ Replace the existing code for the HttpPost `Edit` method with the following code [!code-csharp[](intro/samples/cu/Controllers/DepartmentsController.cs?name=snippet_EditPost)] -The code begins by trying to read the department to be updated. If the `SingleOrDefaultAsync` method returns null, the department was deleted by another user. In that case the code uses the posted form values to create a department entity so that the Edit page can be redisplayed with an error message. As an alternative, you wouldn't have to re-create the department entity if you display only an error message without redisplaying the department fields. +The code begins by trying to read the department to be updated. If the `FirstOrDefaultAsync` method returns null, the department was deleted by another user. In that case the code uses the posted form values to create a department entity so that the Edit page can be redisplayed with an error message. As an alternative, you wouldn't have to re-create the department entity if you display only an error message without redisplaying the department fields. The view stores the original `RowVersion` value in a hidden field, and this method receives that value in the `rowVersion` parameter. Before you call `SaveChanges`, you have to put that original `RowVersion` property value in the `OriginalValues` collection for the entity.