I have a model that has a property FreeAccess. I pass this model to a view, so at the top of the view I have the statement @model XXX.Models.ModelName
I want to be able to do the following:
@if(model.FreeAccess == true)
{
// Do something here
}
but it’s not working. I’ve tried if (model => model.FreeAccess == true) but that comes back with Cannot convert lambda expression to type 'bool'.
So where am I going wrong?
Does the page inherit from the correct type?
If so I think its:
(notice casing)