How to cast using type variable ? consider below code
public static object As(object o1, Type t1)
{
return (t1)o1;
}
But it is showing me an error that t1 is a variable and is used as type. how can i achieve this purpose.Is it possible to retrieve the type from type object.I was asked to implement is and as operators in c# hence the method name.