Skip to content

Model binding record type follow ups #24265

@pranavkm

Description

@pranavkm

The current implementation does not re-initialize a record type model if it's not-null. This means constructor parameters will remain unchanged, but properties will get updated. This might be surprising to users. Here are the interesting scenarios to think about:

Scenario 1: Updating a record type model

var recordTypeModel = new RecordTypeModel("initial-value") { Property1 = "Value1" };
TryUpdateModel(recordTypeModel);

Scenario 1: Updating a record type model that's a property

var container = new ContainerModel { RecordType = new RecordTypeModel("initial-value") { Property1 = "Value1" } };
TryUpdateModel(container);

Metadata

Metadata

Assignees

Labels

area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templates

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions