public static bool AreTypesCompatible(Type sourceType, Type destinationType) { if (!object.ReferenceEquals(sourceType, destinationType)) { if (TypeHelper.IsImplicitNumericConversion(sourceType, destinationType) || TypeHelper.IsImplicitReferenceConversion(sourceType, destinationType) || TypeHelper.IsImplicitBoxingConversion(sourceType, destinationType)) { return(true); } else { return(TypeHelper.IsImplicitNullableConversion(sourceType, destinationType)); } } else { return(true); } }