I am a newcomer in ASP.Net Web API world. Sorry if this is a foolish question.
I have the following api method -
[Route("api/v1/Location/Create")]
[HttpPost]
public IHttpActionResult Create(Location location)
{
if (!ModelState.IsValid)
{
return StatusCode(HttpStatusCode.BadRequest);
}
return Ok();
}
public class Location
{
public int MCC { get; set; }
public int MNC { get; set; }
public int LAC{ get; set; }
public int CellId { get; set; }
}
If I send a string value from client, it still returns StatusCode 200.
What I am missing here?