Say I have the model property bool? IsCool
so I may want to display ‘Y‘ if true and ‘N‘ if false
<span>@Model.IsCool == true ? Y : N</span>
I think that should work.
However how could you get it to work if you wanted a third option of '-' displayed if the value is null?
HasValue is simply private boolean property of Nullable type. It sets to true when Nullable has a value.
And Value just a property of the T type, for “bool?” it will be “bool”: