You mean something like this?
public enum RetType {RetInt, RetBool, RetString};
...
public object PolimorphProperty(string key, RetType how)
{
get
{
switch (how)
{
case RetType.RetInt:
...;
case RetType.RetBool:
...;
case RetType.RetString:
...;
}
}
}
You can return object, but this won't help you, since on caller side you will need to cast it back anyway. You need to know on caller side what type you expect.
You should implement three different getter methods instead.