Function in Class
This commit is contained in:
@@ -48,11 +48,13 @@ namespace CarManagerV2
|
||||
|
||||
public static Car fromCsvString(string csv)
|
||||
{
|
||||
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]));
|
||||
}
|
||||
|
||||
public bool isChanged(Car other)
|
||||
{
|
||||
return make != other.make || model != other.model || year != other.year || color != other.color || mileage != other.mileage || price != other.price;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user