How can I create a function that will have a dynamic return type based on the parameter type?
Like
protected DynamicType Test(DynamicType type)
{
retur
You'd have to use generics for this. For example,
protected T Test(T parameter)
{
}
In this example, the '
' tells the compiler that it represents the name of a type, but you don't know what that is in the context of creating this function. So you'd end up calling it like...
int foo;
int bar = Test(foo);