For example we have the next class :
class Car
{
public string Make { get; set; }
public string Model {get;set;}
public int Year {get;set;}
public string Color {get;set;}
}
And a array with a few car models :
string[] cars = { "Honda", "BMW", "Audi"};
I want to create an object for each item in the array. I've tried with the next code but without success
foreach (var item in cars)
{
Car item = new Car();
}