I have and error in Object reference not set to an instance of an object
<p>Server Error in '/' Application.</p>

<blockquote>
  <p>Object reference not set to an instance of an object.</p>
  
  <p>Description: An unhandled exception occurred during the execution of
  the current web             request. Please review the stack trace for
  more information about the error and where it   originated in the
  code. </p>
  
  <p>Exception Details: System.NullReferenceException: Object reference not
  set to an        instance of an object.</p>
</blockquote>

<pre><code>Source Error: 


Line 29:         &lt;th&gt;&lt;/th&gt;
Line 30:     &lt;/tr&gt;
Line 31:     @foreach (var sections in Model.Sections)
Line 32:     {
Line 33:         &lt;tr&gt;
</code></pre>

<p>my model</p>

<pre><code>using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace TechFactorsLMSV2.Models
{

public class School
{
    public int ID { get; set; }
    public string SchoolName { get; set; }
    public ICollection&lt;Section&gt; Sections { get; set; }
}
public class Section
{
    public int ID { get; set; }
    public string SectionName { get; set; }
    public ICollection&lt;Student&gt; Students { get; set; }
}

public class Student
{
    public int ID { get; set; }
    public string LastName { get; set; }
    public string FirstName { get; set; }
    public string MiddleName { get; set; }
    public string Address { get; set; }
    public DateTime DateEnrolled { get; set; }

}

public class LMSDBContext : DbContext
{
    public DbSet&lt;School&gt; Schools { get; set; }
    public DbSet&lt;Section&gt; Sections { get; set; }
    public DbSet&lt;Student&gt; Students { get; set; }
}
}
</code></pre>

<p>my controller</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using TechFactorsLMSV2.Models;

namespace TechFactorsLMSV2.Controllers
{
public class SchoolsController : Controller
{
    private LMSDBContext db = new LMSDBContext();

    //
    // GET: /Schools/

    public ActionResult Index()
    {
        return View(db.Schools.ToList());
    }
public ActionResult Detail(int id)
    {
        var model = db.Schools.Single(d =&gt; d.ID == id);
        return View(model);
    }
 } 
} 
</code></pre>

<p>my view</p>

<pre><code> TechFactorsLMSV2.Models.School

@{
ViewBag.Title = "Detail";
}

&lt;h2&gt;@Model.SchoolName&lt;/h2&gt;

@Html.ActionLink("Add Section", "Create", "Section", new { SchoolId = @Model.ID }, null      

}

&lt;table&gt;
  &lt;tr&gt;
    &lt;th&gt;Sections&lt;/th&gt;
    &lt;th&gt;&lt;/th&gt;
  &lt;/tr&gt;
  @foreach (var sections in Model.Sections)
{
    &lt;tr&gt;
        &lt;td&gt;@sections.SectionName&lt;/td&gt;
        &lt;td&gt;


        &lt;/td&gt;

    &lt;/tr&gt;
 }


&lt;/table&gt;
</code></pre>
