I wanna check if one type can be cast to another, for example
CanCast(typeof(int), typeof(float))
would return true
however CanCast(typeof(bool), typeof(float))
would return false
Convert.ChangeType
only works with a non-null value so inserting the types is not enough(some of them might be objects so their default value is null)
X is Type
also only works with a value but that's not desirable
How would I be able to replicate the desired above?