int errorCount = ModelState.Sum(x => x.Value.Errors.Count);. If course, at times you just want to know if ModelState has had any errors ...
確定! 回上一頁