left |
right |
left.IsAssignableFrom(right) |
---|---|---|
System.Object | System.Object | True |
System.Object | System.String | True |
System.String | System.Object | False |
System.String | System.String | True |
Created
July 6, 2018 14:38
-
-
Save binki/e7357fbe0989dbe8d04a93fc7a813184 to your computer and use it in GitHub Desktop.
Type.IsAssignableFrom Truth Table
This file contains hidden or 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
Console.WriteLine("| `left` | `right` | `left.IsAssignableFrom(right)` |"); | |
Console.WriteLine("| --- | --- | --- |"); | |
var types = new[] { | |
typeof(object), | |
typeof(string), | |
}; | |
foreach (var left in types) { | |
foreach (var right in types) { | |
Console.WriteLine($"| {left} | {right} | {left.IsAssignableFrom(right)} |"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment