I have a variable with object
type that contain, how example string
value, and Type
variable that contain string
type. I gave a string
as an example, but in general a type variable can contain any type that is the type of a variable.
var result = MethodThatDoingSomething(); //return the tuple (Type, object)
//Variables just for better understanding
Type typeResult = result.Item1;
object valueResult = result.Item2;
var typedValue = valueResult as typeResult; //here i got an error
//Cannot resolve symbol 'typeResult'
I tried and next realization and got same error
var typedValue = (typeResult)valueResult;
//Cannot resolve symbol 'typeResult'
And I don't quite understand how to solve this problem...