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

Answer by Milney for Unexpected 'is' operator result

$
0
0

Probably because PropertyType is a [Type] object, not a date time object...

try:

if (prop.PropertyType == typeof(System.DateTimeOffset)) {    var p = prop.Name;}

Is is for checking the type, i.e.

var maybeAStringOrMaybeAnInt = GetSomeRandomType();if (maybeAStringOrMaybeAnInt is String)

Viewing all articles
Browse latest Browse all 2

Trending Articles



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