How can I check if a ViewModel's property is null in a View?
<p>In a <code>C# MVC 5 View</code>, how can I check if a <code>ViewModel's</code> property is <code>null</code>?</p>

<p>Here is my <code>@model</code> code:</p>

<pre><code>@model DataService.ViewModels.MVC.UserViewModel
</code></pre>

<p>The <code>UserViewModel</code> has a property as follows:</p>

<pre><code>public User userParent
{
    get
    {
        return _userParent;
    }
    set
    {
        _userParent = value;
    }
}
</code></pre>

<p>Here is my <code>View</code> code:</p>

<pre><code>&lt;dd&gt;
    @if (model.userParent != null)
    {
        @Html.DisplayFor(modelItem =&gt; model.userParent.name)
    }
    else
    {

    }
&lt;/dd&gt;
</code></pre>

<p>I am getting the following compiler error:</p>

<blockquote>
  <p>Compiler Error Message: CS0103: The name 'model' does not exist in the
  current context</p>
</blockquote>