Is there a way to call TryParse dynamically? Some kind of:
public static bool TryParse<T>(string toConvert, out T result)
Of course one can use Typeonverters for this. However, an invalid conversion will result in an exception and I want to get rid of this.
You could call the
TryParsemethod dynamically using Reflection. This way you won’t get a time consuming Exception if the conversion fails.This method is a slightly optimized version of this one.