...you will end up with a variable of that type that is just null. Perhaps this won't work with things that cannot be null, but it will jive with a majority of types. I'm learning this is a C# distinction between casting with as versus casting with the type name in parenthesis. Also if you use the is keyword in lieu of the as keyword you can see if the thing in Session is even the type you anticipate in an if statement.
No comments:
Post a Comment