Changes here are all focused around MaxModelErrors on ModelStateDictionary. MaxAllowedErrors now defaults to 200 (same as options). This means that constructing a new ModelStateDictionary with the default constructor will use this default. There's a new constructor for creating a MaxAllowedErrors with a non-default value. The ControllerActionArgumentBinder is now responsible for setting the value from options onto ActionContext.ModelState. This results in better layering and guarantees the option is respected if someone uses extensibility to call model binding. ModelStateDictionary.CanAddErrors is renamed to MaxErrorsReached. We wanted to change the behavior of this property, but realized that it's very useful inside the model validation code, so opted to renamed. There's also a bunch of doc cleanup inside ModelStateDictionary to simplify things and improve clarity. |
||
|---|---|---|
| .. | ||
| ControllerActionArgumentBinderTests.cs | ||
| ModelBindingHelperTest.cs | ||