View ModelState errors while debugging
Today I learned how you can view the Modelstate errors while debugging a controller in Asp.Net: ModelState.Where(x => x.Value.Errors.Count > 0).Select(x => x.Key).ToList() Just paste that in the watch window. If you’ve tried debugging to find what field is causing the Modelstate to be invalid, you’ll know how tedious it is to dig through but thanks to this post for this handy tip!