New to .NET Core.
What am I doing wrong? Here is my controller
[Route("api/[controller]")]
public class customerController : Controller
{
// GET: api/values
//[HttpGet]
//public IEnumerable<string> Get()
//{
// return new string[] { "value1", "value2" };
//}
// GET api/values/5
[HttpGet("{id}")]
public customer Get(int id)
{
var repo = new customerRepository();
return repo.GetCustomerOnPhone(id);
}
}
I am able to call the API with this URL
http://localhost:51375/api/customer/8172858817
I hit the breakpoint in GET method, but Id is always zero. I cannot get the method to read the value which is being passed from URL.
Any suggestions?
2147483647Your value is too large. change tolong- Nkosi