I have a simple question.
Scenario: Method to update data, when user don't fill the field speed (dt.Row[9]).
//Car.speed is float and dt.row[9] is a object
float speedo;
float.TryParse(dt.Row[9].ToString(), out speedo);
Car.speed = speedo
or
Car.speed = dt.Row[9].ToString().Equals(string.Empty) ? 0 : Convert.ToSingle(dt.Row[9])
Considering performance and good code, what is better? Any suggestion?
I know it's not a big deal, but I have many class with many attribute of type float. So it's only to have a code more clean.