- #5873
- creating an EXE for the test project seems to work around #5873
- also avoids dotnet/sdk#926 when building in Visual Studio
nit: clean up duplicate test data
- now, if client sends e.g. `Content-type: text/json;charset=[invalid]`, service will respond with HTTP/415
- if client sends `Content-type: text/json`, service will still try UTF-8 (or updated default encoding)
- intentional (and slight) behaviour change from 1ac7315
- include and a few new tests and some cleanup from same commit
- #5351
- fix affects only `TextInputFormatter`
- `TextOutputFormatter` already does the Right Thing™️ with `Accept-Charset` headers
- `ResponseContentTypeHelper` uses `Encoding.GetEncoding()` but is not passed request data
- #5349
- fix or add comments about other parsing errors and inconsistencies
- `MediaType` did not skip whitespace before the type
nits:
- use `+=`
- `<code>` -> `<c>` since the former is not for use within a paragraph
- split tests up to remove `bool expectedResult` parameters
- #3918
- precompute size of `StringBuilder` in `ExpressionHelper`
- reduce `string` allocations in `ViewDataEvaluator`
- also get rid of `Enumeration` state machines
- reduce the size of a few objects; use more expression-valued properties
- e.g. don't store `_modelType` in `ModelExplorer`
- add `EmptyArray<TElement>`; make empty arrays consistently `static`
- avoid `string.Split()` in HTML and tag helpers
nits:
- make `ExpressionHelperTest` tests more stringent
- correct `Message` for an `ArgumentNullException`
- remove excess `using`s in classes I touched (but often ended up leaving otherwise unchanged)
- improve doc comments
- remove `ToString()` call on a `string`
- avoid encoding `string.Empty`
- fix test file name
- remove useless variables
- correct spelling
- improve whitespace
- #4339: remove non-recommended JSON formatter constructors
- affects `JsonInputFormatter`, `JsonOutputFormatter`, `JsonPatchInputFormatter`
- `JsonOutputFormatter` cleanup also impacts `JsonHelper`
- rename and make `SerializerSettingsProvider` class public; use it as appropriate
- #4409: make `SerializerSetings` properties get-only and `protected`
- affects `JsonInputFormatter`, `JsonOutputFormatter`
Recommended patterns:
- change `JsonSerializerSettings` values in `MvcJsonOptions` for almost all customizations
- find `JsonOutputFormatter` in `MvcOptions.OutputFormatters` when limiting per-result formatters
- start with `JsonSerializerSettingsProvider.CreateSerializerSettings()` when customizing a per-result formatter
* Broken InputFormatter into InputFormatter and TextInputFormatter
* Added an exception to ModelState inside ReadAsync on TextInputFormatter
when we can't find a valid encoding to read the body.