public IHttpActionResult ActualizarMaterial([FromBody] Material material) { var idMaterial = materialData.Actualizar(material); try { if (ModelState.IsValid) { return(Json(new { Success = true, Message = idMaterial })); } else { return(Json(new { Success = false, Message = string.Join("; ", ModelState.Values .SelectMany(x => x.Errors) .Select(x => x.ErrorMessage)) })); } } catch (Exception exp) { return(Json(new { Success = false, Message = exp.Message })); } }