Fix copy/paste error (#247)

pull/248/head
Tom Dykstra 2024-01-19 15:32:14 -08:00 committed by GitHub
parent 66e783bcad
commit b24f6b3845
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 4 additions and 4 deletions

View File

@ -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);
}
// </snippet_CreateAsyncActionResultOfT>
}

View File

@ -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);
}
// </snippet_CreateAsyncIActionResult>
}

View File

@ -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);
}
// </snippet_CreateAsyncIResult>

View File

@ -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);
}
// </snippet_CreateAsyncResultsOfT>