C# web API: Why int value changing to hex value by itself?

0

I am facing some weird issue, appreciate any help on this.

I am using VS 2019 and .Net Core 2.2. In VS created new web api and if I pass integer value 5 in the controller the id value shows as hex ( id = 0x00000005) also I declared integer as below and shows the value as s = 0x00000009. I don't have any code or settings to change hex value. Tested with new web api project with endpoint https://localhost:44358/api/values/5. Decimal, string type works as expected. Please help me here.

    // GET api/values/5
    [HttpGet("{id}")]
    public ActionResult<string> Get(int id)
    {
        int s = 9;
        return "value";
    }

Appreciate any help.

c#
.net
webapi

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0