How to create a Nullable<T> from a Type variable?
问题 I'm working with expressions and I need a method which receives an object of some type (currently unknown). Something like this: public static void Foobar(object Meh) { } What I need to is make this method return a Nullable<T> version of Meh , but the type T is from Meh.GetType() . So the return would be Nullable<MehType> , where MehType is the type of Meh . Any ideas or suggestions? Thanks Update: the reason why I needed this is because of this exception: The binary operator Equal is not