1
Vote

ModelState.IsValid not returning true, ever

description

If I call ModelState.IsValid, it never returns true.
 
{{
[HttpPost]
    [Api]
    public ActionResult SingleCustomer(string customerId, string verb, [ApiBind]Customer changeCustomer)
    {
        if (verb == "Save")
        {
            if (ModelState.IsValid)
            {
                var existingCustomer = GetModel().Customers.First(c => c.CustomerId == customerId);
                existingCustomer.Name = changeCustomer.Name;
                existingCustomer.Country = changeCustomer.Country;
            }
}}

comments