Go to file
Doug Bunting 48f09d0e8d Do not trounce existing property values that are not bound in `TryUpdateModel` scenarios
- #2836

Part 1: Use existing property values when recursing in `MutableObjectModelBinder`
- remove `ComplexModelDTO` because that indirection made fixing this issue more difficult and doesn't add value
  - started with an old closed PR (#2241) which did some of this work
- correct `MutableObjectModelBinderTest` tests that exercised behaviour that can't occur
  - the old `dto.Results` dictionary was never incomplete; nor could it contain `null` values

Part 2: Change `MutableObjectModelBinder` to pass complex property values into binding system
- model binding no longer trounces nodes in the model tree that aren't bound
- create model instances less often in `TryUpdateModel` scenarios
  - refactor `EnsureModel()` to `GetModel()` and use appropriately
- reorder logic in `SetProperty()` and `AddToProperty()` to avoid copying to / from the same collection
  - also cleans up some code duplication

nits:
- clean up `MutableObjectModelBinderTest`
  - fix odd line wrappings and indentation
  - use `nameof()` more
  - use `string.Empty` more
  - simplify a couple of `Returns()` expressions
- make assertions in `TryUpdateModelIntegrationTest` more readable
  - no need to work through `ModelStateDictionary.Keys`
  - also use `Length` instead of `Count()`; test code but we don't need Linq at all in that test class
2015-08-18 09:57:41 -07:00
samples Homogenize MVC startup code patterns 2015-08-16 18:48:24 -07:00
src Do not trounce existing property values that are not bound in `TryUpdateModel` scenarios 2015-08-18 09:57:41 -07:00
test Do not trounce existing property values that are not bound in `TryUpdateModel` scenarios 2015-08-18 09:57:41 -07:00
.gitattributes
.gitignore
.travis.yml Fixing tests in Mono. 2015-07-02 17:24:14 -07:00
CONTRIBUTING.md Update Home master -> Home dev 2015-05-12 11:26:36 -07:00
LICENSE.txt
Mvc.NoFun.sln Fix #2338 - Add ViewComponentResult 2015-07-23 17:52:52 -07:00
Mvc.sln Added Mvc localization project 2015-07-16 15:57:24 -07:00
NuGet.Config Updating to release NuGet.config. 2015-08-17 14:49:34 -07:00
README.md
Settings.StyleCop
appveyor.yml
build.cmd Enable pinning build script 2015-08-11 16:52:20 -07:00
build.sh Change hardcoded `bash` shebang to `env` 2015-06-23 11:02:33 -07:00
global.json
makefile.shade

README.md

ASP.NET MVC

AppVeyor: AppVeyor

Travis: Travis

ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that enables a clean separation of concerns and gives you full control over markup for enjoyable, agile development. ASP.NET MVC includes many features that enable fast, TDD-friendly development for creating sophisticated applications that use the latest web standards.

ASP.NET MVC in ASP.NET 5 includes support for building web pages and HTTP services in a single aligned framework that can be hosted in IIS or self-hosted in your own process.

This project is part of ASP.NET 5. You can find samples, documentation and getting started instructions for ASP.NET 5 at the Home repo.