USE plural names for controllers
Benefit of using plural names for controllers is that it makes it easier to create RESTful APIs, which are a common way to build web applications. RESTful APIs use URLs that are based on the resources that they manage, and using plural names for controllers helps to ensure that the URLs are consistent and easy to understand.
namespace AcmeApi.V1.Controllers
{
[ApiController]
[ApiVersion("1.0")]
[Route("v{version:apiVersion}/users")]
[ApiExplorerSettings(GroupName = "Users")]
public class UsersV1Controller : ControllerBase
{
private readonly IDistributedCache _distributedCache;
private readonly BtcTurkDbContext _btcTurkDbContext;
public UsersV1Controller(BtcTurkDbContext btcTurkDbContext, IDistributedCache distributedCache)
{
_distributedCache = distributedCache;
_btcTurkDbContext = btcTurkDbContext;
}
[HttpGet("{id}")]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(GetUserResponse))]
public async Task<IActionResult> GetUser([FromRoute] long id)
{
return Ok();
}
}
}