Fix copy/paste error (#247)
parent
66e783bcad
commit
b24f6b3845
|
@ -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>
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue