title: c# Creating a list with user input
body: <p>I'm fairly new to c# and having difficulty with lists.</p>
  
  <p>I'm creating an application that takes in a user's name, age, and address, then stores it in a list when the user clicks the 'add' button.
  I'm using a GUI with text boxes for user input.</p>
  
  <p>I have made a Customer class and unsure what to do next. I've followed tutorials and other questions but can't seem to find an answer.</p>
  
  <pre><code>public class Customer
  {
      private string name;
      private Int32 age;
      private string address1;
      private string address2;
      private string address3;
  
  
      public string Name
      {
          get
          {
              return name;
          }
  
          // if name is blank throw argument asking user for input
  
          set
          {
              if (name == "")
              {
                  throw new ArgumentException("Please enter your name");
              }
              else 
              {
                  name = value;
              }
          }
      }
  
      public Int32 Age
      {
          get
          {
              return age;
          }
  
          set
          {
                  age = value;
          }
      }
  
  
      // get/set address
  
      public string Address1
      {
          get
          {
              return address1;
          }
  
          set
          {
              if (address1 == "")
              {
                  throw new ArgumentException("Please enter your address");
              }
              else
              {
                  address1 = value;
              }
          }
      }
  
      public string Address2
      {
          get
          {
              return address2;
          }
  
          set
          {
              if (address2 == "")
              {
                  throw new ArgumentException("Please enter your adress");
              }
              else
              {
                  address2 = value;
              }
          }
      }
  
      public string Address3
      {
          get
          {
              return address3;
          }
  
  
          set
          {
              if (address3 == "")
              {
                  throw new ArgumentException("Please enter your adress");
              }
              else
              {
                  address3 = value;
              }
          }
      }
  </code></pre>