function
This commit is contained in:
@@ -18,6 +18,7 @@ namespace CarManagerV2
|
||||
|
||||
public Car(int id, string make, string model, int year, string color, int mileage, decimal price)
|
||||
{
|
||||
this.id = id;
|
||||
this.make = make;
|
||||
this.model = model;
|
||||
this.year = year;
|
||||
@@ -50,6 +51,7 @@ namespace CarManagerV2
|
||||
Console.WriteLine(csv);
|
||||
string[] parts = csv.Split(';');
|
||||
Console.WriteLine(parts.Length);
|
||||
Console.WriteLine($"Fetched ID: {parts[0]}");
|
||||
return new Car(int.Parse(parts[0]), parts[1], parts[2], int.Parse(parts[3]), parts[4], int.Parse(parts[5]), decimal.Parse(parts[6]));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user