I try to cast a variable type of Object int to a var.
My try is:
var dummy = (items[items.Count() - 1].GetType()) items[items.Count()-1];
I dunno what I’m doing wrong, i cant see my error, but the debugger says that only assign, decrement and “new Object”-expressions can be used as a command… But that’s what I’m doing…
Can somebody show me my error?
Many thanks in advance, and sorry for that “beginnerquestion”.
You need to use Convert.ChangeType