I have a shared view that is used by 4 different parent views. In the shared view, I need to do a simple check:
if (Model.foo == barr)
{...]
The problem is, in one of the 4 models, there is no foo. I'd rather not add it to the one model to just avoid the error:
does not contain a definition for 'foo'
I'm wondering if I can do a pre-check, something like..
if (Model.Contains(foo) && Model.foo == bar)
{...}
Is anything like that possible?