title: On Demand data loading with Entity Framework
body: <p>I am creating graphic application and where the user can import the graphic data from a SQL Sever database. This application should be capable of handling at least 100,000+ entities. The idea to load the data faster is to load the visual data while opening the database file and non-visual data will be loaded on demand. So, the problem which I am facing is with the data loading from database using Entity Framework.</p>
  
  <p>Each entity has a visual and a non-visual data associated and following is an example of one of the entity:</p>
  
  <pre><code>class Polyline
  {
    Guid ID {get; set;}
    PolylineGeometry PGeometry {get; set;}
    PolylineAttribData PAttribData {get; set;}
  }
  class PolylineGeometry
  {
    List&lt;Point3D&gt; PointCollection {get; set;}
  }
  class PolylineAttribData
  {
    Image ImageData {get; set;}
  }
  </code></pre>
  
  <p>My context class is as follows:</p>
  
  <pre><code>class GeometryData : DbContext
  {
    DbSet&lt;Polyline&gt; Polylines {get; set;}
  }
  </code></pre>
  
  <p>So, when we create the database context or the geometry data initially only the ID is loaded into polyline and PGeometry &amp; PAttribData is not loaded. So, how do I load this data?</p>
  
  <p>Thank You,</p>
  
  <p>Pankaj</p>