Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

The binder should be able to bind to List property on a model #2169

Open
jchannon opened this issue Dec 18, 2015 · 0 comments
Open

The binder should be able to bind to List property on a model #2169

jchannon opened this issue Dec 18, 2015 · 0 comments

Comments

@jchannon
Copy link
Member

If you have a model like so:

public class TestModel
{        
     public List<Friend> Friends { get; set; }
}

public class Friend
{
    public string Name { get; set; }
    public int Age { get; set; }
}

And you post data such as the below, the model binder will not assign the List property to the posted data

context.Request.Form["Friends[0].Name"] = "Steven";
context.Request.Form["Friends[0].Age"] = "21";
context.Request.Form["Friends[1].Name"] = "Andreas";
context.Request.Form["Friends[1].Age"] = "42";
@jchannon jchannon added this to the 2.0 milestone Dec 18, 2015
@khellang khellang modified the milestones: 2.0, 2.0-beta Mar 22, 2016
@thecodejunkie thecodejunkie modified the milestones: 2.0-barneyrubble, 2.1 Jul 12, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants