title: object reference not set to an instance of an object scaffolding mvc
body: <p>I have a problem to scaffolding my model.
  I get following error "object reference not set to an instance of an object"</p>
  
  <p>My model :</p>
  
  <pre><code>public class Position
  {
      [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
      public long PositionID { get; set; }
      public long OfferID { get; set; }
      [Required]
      [Display(Name = "Positie omschrijving")]
      public string Name { get; set; }
      [Required]
      public int PositionNr { get; set; }
      [Required]
      public double WorkingHeight { get; set; }        
      public long PalletTypeID { get; set; }        
      public long MotorTypeID { get; set; }        
      public long Enveriment { get; set; }   
  }
  </code></pre>
  
  <p>My DBContext :</p>
  
  <pre><code>public class FlowContext : DbContext
  {
      public DbSet&lt;Position&gt; Positions { get; set; }
  
      protected override void OnModelCreating(DbModelBuilder modelBuilder)
      {
          base.OnModelCreating(modelBuilder);
  
          modelBuilder.Conventions.Remove&lt;PluralizingTableNameConvention&gt;();
          this.Configuration.LazyLoadingEnabled = true;
  
          //Positie
          modelBuilder.Entity&lt;Position&gt;()
              .HasKey(j =&gt; j.PositionID);
      }
  }
  </code></pre>
  
  <p>My connection string in web.config</p>
  
  <pre><code>&lt;connectionStrings&gt;
      &lt;add name="FlowContext" connectionString="data source=.\SqlExpress; Integrated Security=True;Initial Catalog=Flow;" providerName="System.Data.SqlClient" /&gt;
  </code></pre>
  
  <p></p>