>>663
ハードコード避けたいときはnameofとかtypeof使うといいとかsampleかいてあったような。

//return CreatedAtAction("GetTodoItem", new { id = todoItem.Id }, todoItem);
return CreatedAtAction(nameof(GetTodoItem), new { id = todoItem.Id }, todoItem);

https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-web-api?view=aspnetcore-3.1&;tabs=visual-studio
Web APIのTutorialのコード。

References the GetTodoItem action to create the Location header's URI.
The C# nameof keyword is used to avoid hard-coding the action name in the CreatedAtAction call.