Quantcast
Channel: Unexpected 'is' operator result - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Unexpected 'is' operator result

$
0
0

Testing for the DateTimeOffSet using the 'is' operator never passes. In the following sample I know the DateTimeOffset type is one of the properties but it never returns True. Thanks for helping me understand why?

foreach (var prop in qSOs.GetListType().GetProperties()){    Console.WriteLine(prop.PropertyType); // System.DateTimeOffset    if (prop.PropertyType is System.DateTimeOffset) // Never returns True    {        var p = prop.Name;    }}

Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>