Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Regression in 1.1 model binding for model types without default constructor #5698

@Tragetaschen

Description

@Tragetaschen

In 1.1, the ComplexTypeModelBinderProvider started to check for a default constructer: d09e921. This breaks my application.

I'm using a controller that calls TryUpdateModelAsync with a preconstructed IValueProvider and model instances:

await TryUpdateModelAsync(
    model,
    model.GetType(),
    prefix,
    valueProvider,
    a => true
);

Some of the model types don't have default constructors, most notably because I need some external dependencies for IValidatableObject. These model types now don't work anymore and my entire controller action fails.

The above commit doesn't really contain any information why this change was introduced and the binder itself doesn't require a default contsructor when the model object is pre-constructed

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions