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
Whilst the accepted answer is good, it has been over two years since it was written, so, I should add that you can use:
protected dynamic methodname(dynamic input)
{
return input;
}
Input will be returned as the same type, and you do not need to call the method as a generic.
Reference:
https://msdn.microsoft.com/en-us/library/dd264736.aspx