ready to use uint route constraint?
问题 I have a .NET Core Web API project and my Ids are integers starting at 1. In most samples I see something like this [HttpGet("{id:int}")] public async Task<ActionResult<User>> GetUserByIdAsync([FromRoute] int id) { // ... } Since I know Ids must be greater than 0 I also added the :min(1) route constraint. But wouldn't it be better to change the integer datatype to uint ? The route would then be "{id:uint:min(1)}" and the method parameter will change to [FromRoute] uint id but unfortunately