Html.DropDownListFor with null selectList parameter
<p>This is taken from VS <code>Add New Scaffolded Item...</code> when creating a new controller.</p>

<p>In the controller:</p>

<pre><code>// GET: Drivers/Create
public ActionResult Create()
{
    ViewBag.Tenant = new SelectList(db.Tenants, "TenantID", "TenantName");
    return View();
}
</code></pre>

<p>The view then renders a drop-down list:</p>

<pre><code>@Html.DropDownListFor(model =&gt; model.Tenant, null, htmlAttributes: new { @class = "form-control" })
</code></pre>

<p>The relevant model information:</p>

<pre><code>public partial class Driver
{
    public int DriverID { get; set; }
    public int Tenant { get; set; }
    public virtual Tenant Tenant1 { get; set; }
}

public partial class Tenant
{
    public Tenant()
    {
        this.Drivers = new HashSet&lt;Driver&gt;();
    }

    public int TenantID { get; set; }
    public string TenantName { get; set; }
    public virtual ICollection&lt;Driver&gt; Drivers { get; set; }
}
</code></pre>

<p>Can someone explain why this works? </p>

<p>I looked at other questions and documentation and couldn't find the answer.  I suspect it is something along the lines of "convention over configuration" and it is pulling from the <code>ViewBag</code> using the name of the property.  In fact, I changed the <code>ViewBag</code> property to <code>Tenantz</code> and got the following exception:</p>

<blockquote>
  <p>There is no ViewData item of type 'IEnumerable' that
  has the key 'Tenant'.</p>
</blockquote>

<p>So is setting the property name of the <code>ViewBag</code> the same as the model property you want to update a good practice?  It seems ok but I always hear how you should avoid <code>ViewBag</code> and dynamic types.</p>