title: Copying one list to another
body: <p>I have a list of viewmodels which contains vehicle data such as this 
  public IList VehicleViewModelList { get; set; } initialized to this</p>
  
  <pre><code>  VehicleViewModelList = new List&lt;VehicleViewModel&gt;();
  </code></pre>
  
  <p>which contains same property as is in the IParking_Vehicle interface i.e.</p>
  
  <pre><code>    string Type { get; set; }
  
      string Make { get; set; }
  
      string Model { get; set; }
  
      string RegNo { get; set; }
  
      string DriverName { get; set; }        
  
      string User { get; set; }
      System.DateTime Time { get; set; }
  
  public class VehicleViewModel
  {
      [Required(ErrorMessage = "Registration is required")]
      [DisplayName("Vehicle Registration")]
      public String RegNo { get; set; }
  
      [Required(ErrorMessage = "Make is required")]
      [DisplayName("Vehicle Make eg Jaguar etc")]
      public String Make { get; set; }
  
      [Required(ErrorMessage = "Model is required")]
      [DisplayName("Vehicle Model eg XFK")]
      public String Model { get; set; }
  
      [DisplayName("Car Type")]
      public IEnumerable&lt;SelectListItem&gt; CarType { get; set; }
  
      [Required(ErrorMessage = "Car type is required")]
      [DisplayName("Vehicle Type")]
      public string CarTypeValue { get; set; }
  
      public VehicleViewModel()
      {
          CarType = new SelectList(new List&lt;string&gt;()
                     { "CompanyCar", "PersonalCar" }.AsEnumerable&lt;string&gt;());
      }
  }
  </code></pre>
  
  <p>Now when I create a list of </p>
  
  <pre><code>var _parkingVehicleList = new List&lt;IParking_Vehicle&gt;(), 
       I want to transfer all the values from     
   VehicleViewModelList to this _parkingVehicleList.
  </code></pre>
  
  <p>So far this complains</p>
  
  <pre><code>for (int i = 0; i &lt;= (_eam.No_of_Vehicles - 1); i++)
  {
      _parkingVehicle.DriverName = _eam.DriverNameList[i].DriverName;
      _parkingVehicle.Active = true;
      _parkingVehicle.Make = _eam.VehicleViewModelList[i].Make;
      _parkingVehicle.Model = _eam.VehicleViewModelList[i].Model;
      _parkingVehicle.RegNo = _eam.VehicleViewModelList[i].RegNo;
      _parkingVehicle.Time = DateTime.Now;
      _parkingVehicle.ParkingApplication = _parkingApplication;
      _parkingVehicle.User = UserName.IntranetUser;
  
      _parkingVehicleList.Add(_parkingVehicle);
  
      //_parkingVehicleList[i].DriverName. = _eam.DriverNameList[i].DriverName;
      //_parkingVehicleList[i].Make = _eam.VehicleViewModelList[i].Make;
      //_parkingVehicleList[i].Model = _eam.VehicleViewModelList[i].Model;
      //_parkingVehicleList[i].RegNo = _eam.VehicleViewModelList[i].RegNo;
      //_parkingVehicleList[i].Time = DateTime.Now;
      //_parkingVehicleList[i].Type = _eam.VehicleViewModelList[i].CarTypeValue;
      //_parkingVehicleList[i].Active = true;
      //_parkingVehicleList[i].ParkingApplication = _parkingApplication;
      //_parkingVehicleList[i].User = UserName.IntranetUser;
  
  }
  </code></pre>
  
  <p>_parkingVehicleList complains because of indexer..(cant figure out why?), so its commented out...</p>
  
  <p>and not commented part adds the same value twice, so first values are lost..any solutions??</p>