In debug mode, I'm hovering over my variable, and it shows that it is {object[0]}:
However, this IF statement is never getting triggered.
How do I check for this object[0] type?
In debug mode, I'm hovering over my variable, and it shows that it is {object[0]}:
However, this IF statement is never getting triggered.
How do I check for this object[0] type?
To check that an
objectis aobject[], your checkelement is object[]is already correct.To check that an
object[]is empty, callingAny()is already correct, but make sure to call it on the right instance. Avoid thatToEnumerable()extension method, since it's not doing what you're hoping for.Test:
This includes some test cases that could be an indication that the check you're attempting to do isn't a good idea, but it also indicates that it gives accurate results.