title: Blazor EditForm bind from List
body: <p>I'm trying to make a page to edit customer data.</p>
  <p>The customer object has a list of phonenumbers(string) , because most have a landline and cellphone.
  I can't seem to find a way to put this into an editform. I tried using a foreach loop, but it can't bind to this.
  I also tried to use a local copy in the loop and bind to that. That works, but i can't retrieve the changes after the submit button is pressed.
  What am i doing wrong ? What is the proper way to do this ? I can't seem to find any tutorial that covers this.</p>
  <p>I have recreated my page to the minimal that does the same thing:</p>
  <p>This is my Customer class</p>
  <pre><code>public class Customer
      {
          public string Name { get; set; }
          // arbitrary extra fields
          public List&lt;string&gt; phoneNumber { get; set; }
      }
  }
  
   public class CustomerService
      {
          Customer jeff;
  
          public CustomerService()
          {
              jeff = new Customer
              {
                  Name = &quot;Jeff&quot;,
                  phoneNumber = new List&lt;string&gt; { &quot;123456&quot;, &quot;654321&quot; },
              };
          }
  
          public Customer getCustomer()
          {
     
              return jeff;
          }
  
          public void setCustomer(Customer cust)
          {
              jeff = cust;
          }
      }
  </code></pre>
  <p>And my page</p>
  <pre><code>&lt;EditForm Model=&quot;@customer&quot; OnSubmit=&quot;@submitChanges&quot;&gt;
  
      &lt;InputText id=&quot;name&quot; @bind-Value=&quot;@customer.Name&quot; /&gt;&lt;br/&gt;
      &lt;!-- How do i link the multiple phonenumbers--&gt;
  
      @foreach(string phone in customer.phoneNumber)
      {
          //this does not compile
          //&lt;InputText @bind-Value=&quot;@phone&quot;/&gt;
  
          //this compiles but i can't find how to acces the data afterward ???
          string temp = phone;
          &lt;InputText @bind-Value=&quot;@temp&quot;/&gt;
  
      }
  
      @for(int i=0;i&lt;customer.phoneNumber.Count();i++)
      {
          //this compiles but chrashed at page load
          // &lt;InputText @bind-Value=&quot;@customer.phoneNumer[i]&quot;/&gt;
      }
  
  
      &lt;button type=&quot;submit&quot;&gt;submit&lt;/button&gt;
        
  &lt;/EditForm&gt;
  </code></pre>
  <h5>Code Section</h5>
  <pre><code>@code {        
  
      Customer customer;
     
      protected override void OnInitialized()
      {
          customer = _data.getCustomer();           
      }
  
      private void submitChanges()
      {
          _data.setCustomer(customer);
      }
  }
  </code></pre>