I have this classes:
public class Bar
{
public string Name;
}
puclic class Foo
{
public string Age {get;set;}
public List<Bar> Bars {get;set;}
}
I want to display in Foo View infomations about each of its Bar, for example:
@Html.EditorFor(model => Model.Bars.ElementAt(1).Bar.Name)
Is this the correct approach using Razor/Html Helpers? If i change the value of Bars[1] then post to controlller it will update the value in model? And for last, how i can create dynamically bars using the foo view and assign them to foo's bar list model?