I have a method that is defined like such:
public bool IsValid(string propertyName, object propertyValue)
{
bool isValid = true;
// Validate property based on type here
return isValid;
}
I would like to do something like:
if (propertyValue is bool?)
{
// Ensure that the property is true
}
My challenge is, I'm not sure how to detect whether my propertyValue is a nullable bool or not. Can someone tell me how to do this?
Thank you!