.

Setting property by reflection

Setting property by reflection:

Ship ship = new Ship();
string value = "5.5";
PropertyInfo propertyInfo = ship.GetType().GetProperty("Latitude");
propertyInfo.SetValue(ship, Convert.ChangeType(value, propertyInfo.PropertyType), null);

What's your thoughts on this?

*

Protected by WP Anti Spam