Last active
January 27, 2016 19:06
-
-
Save Vannevelj/3e3d3b9a0fc4391c046e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyClass | |
{ | |
private int oAsInt32; | |
void Method(object o) | |
{ | |
var oAsInt32 = o as int?; | |
if (oAsInt32 != null) | |
{ | |
Console.Write(oAsInt32.Value); | |
} else { | |
Console.Write(this.oAsInt32); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyClass | |
{ | |
private int oAsInt32; | |
void Method(object o) | |
{ | |
if (o is int) | |
{ | |
Console.Write((int) o); | |
} else { | |
Console.Write(oAsInt32); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyClass | |
{ | |
private int oAsInt32; | |
void Method(object o) | |
{ | |
var oAsInt32 = o as int?; | |
if (oAsInt32 != null) | |
{ | |
Console.Write(oAsInt32.Value); | |
} else { | |
Console.Write(oAsInt32); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment