From b24f6b3845a2cb1956081dd883abeb016ab254e6 Mon Sep 17 00:00:00 2001 From: Tom Dykstra Date: Fri, 19 Jan 2024 15:32:14 -0800 Subject: [PATCH] Fix copy/paste error (#247) --- .../Controllers/ActionResultOfTProductsController.cs | 2 +- .../WebApiSample/Controllers/ActionResultProductsController.cs | 2 +- .../8.x/WebApiSample/Controllers/IResultProductsController.cs | 2 +- .../WebApiSample/Controllers/ResultsOfTProductsController.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mvc/action-return-types/8.x/WebApiSample/Controllers/ActionResultOfTProductsController.cs b/mvc/action-return-types/8.x/WebApiSample/Controllers/ActionResultOfTProductsController.cs index 0216d54..58f7134 100644 --- a/mvc/action-return-types/8.x/WebApiSample/Controllers/ActionResultOfTProductsController.cs +++ b/mvc/action-return-types/8.x/WebApiSample/Controllers/ActionResultOfTProductsController.cs @@ -41,7 +41,7 @@ public class ActionResultOfTProductsController : ControllerBase _productContext.Products.Add(product); await _productContext.SaveChangesAsync(); - return CreatedAtAction(nameof(GetById_ActionResultOfT), new { id = product.Id }, product); + return CreatedAtAction(nameof(CreateAsync_ActionResultOfT), new { id = product.Id }, product); } // } diff --git a/mvc/action-return-types/8.x/WebApiSample/Controllers/ActionResultProductsController.cs b/mvc/action-return-types/8.x/WebApiSample/Controllers/ActionResultProductsController.cs index 85737d5..b006799 100644 --- a/mvc/action-return-types/8.x/WebApiSample/Controllers/ActionResultProductsController.cs +++ b/mvc/action-return-types/8.x/WebApiSample/Controllers/ActionResultProductsController.cs @@ -41,7 +41,7 @@ public class ActionResultProductsController : ControllerBase _productContext.Products.Add(product); await _productContext.SaveChangesAsync(); - return CreatedAtAction(nameof(GetById_IActionResult), new { id = product.Id }, product); + return CreatedAtAction(nameof(CreateAsync_IActionResult), new { id = product.Id }, product); } // } diff --git a/mvc/action-return-types/8.x/WebApiSample/Controllers/IResultProductsController.cs b/mvc/action-return-types/8.x/WebApiSample/Controllers/IResultProductsController.cs index d03f7d2..af3be21 100644 --- a/mvc/action-return-types/8.x/WebApiSample/Controllers/IResultProductsController.cs +++ b/mvc/action-return-types/8.x/WebApiSample/Controllers/IResultProductsController.cs @@ -41,7 +41,7 @@ public class IResultProductsController : ControllerBase _productContext.Products.Add(product); await _productContext.SaveChangesAsync(); - var location = Url.Action(nameof(GetById), new { id = product.Id }) ?? $"/{product.Id}"; + var location = Url.Action(nameof(CreateAsync), new { id = product.Id }) ?? $"/{product.Id}"; return Results.Created(location, product); } // diff --git a/mvc/action-return-types/8.x/WebApiSample/Controllers/ResultsOfTProductsController.cs b/mvc/action-return-types/8.x/WebApiSample/Controllers/ResultsOfTProductsController.cs index dd74f9b..e151fce 100644 --- a/mvc/action-return-types/8.x/WebApiSample/Controllers/ResultsOfTProductsController.cs +++ b/mvc/action-return-types/8.x/WebApiSample/Controllers/ResultsOfTProductsController.cs @@ -36,7 +36,7 @@ public class ResultsOfTProductsController : ControllerBase _productContext.Products.Add(product); await _productContext.SaveChangesAsync(); - var location = Url.Action(nameof(GetById), new { id = product.Id }) ?? $"/{product.Id}"; + var location = Url.Action(nameof(CreateAsync), new { id = product.Id }) ?? $"/{product.Id}"; return TypedResults.Created(location, product); } //