billbogaiv / hybrid-model-binding

Provides the ability to bind models using both ModelBinder and ValueProvider in ASP.NET Core.
MIT License
104 stars 19 forks source link

Add bind support for collections #22

Closed billbogaiv closed 5 years ago

billbogaiv commented 5 years ago

New behavior does additional checks on data coming from value providers. There are now two possibilities: the provider returns one-value or a collection of values. The former does what is already being done. The latter goes through an additional process to take the collection, convert each element, and insert into a temporary list matching the type of the model's property. Assuming counts from the value provider's collection and the temporary list match, then the values are set on the model.

billbogaiv commented 5 years ago

I'm going to merge this since it works okay for now and I'm doing additional work here related to https://github.com/billbogaiv/hybrid-model-binding/pull/26 and prefer not to deal with the merge conflicts later.

billbogaiv commented 5 years ago

Ref. https://github.com/billbogaiv/hybrid-model-binding/issues/21