// IsFooBar being a boolean, we check if it's different from true and from false
if (x.IsFooBar != true && x.IsFooBar != false)
{
    return "error";
}

x.IsFooBar is juste a regular bool

By A senior developer, 2018-05-14 14:46:14