Eager , Lazy and explicit loading in EF6
<p>I have read this <a href="http://www.entityframeworktutorial.net/EntityFramework5/entity-framework5-introduction.aspx" rel="noreferrer">tutorial</a> and this <a href="https://msdn.microsoft.com/en-us/data/jj574232.aspx" rel="noreferrer">article</a> but I don't understand exactly the use of each loading type.</p>

<p><strong>I Explain</strong></p>

<p>I have this POCO :</p>

<pre><code>public partial class dpc_gestion
{
    public dpc_gestion()
    {
        this.ass_reunion_participant = new HashSet&lt;ass_reunion_participant&gt;();
        this.dpc_participant = new HashSet&lt;dpc_participant&gt;();
        this.dpc_reunion = new HashSet&lt;dpc_reunion&gt;();
    }

    public int dpc_id_pk { get; set; }
    public Nullable&lt;int&gt; dpc_id_gdp_fk { get; set; }
    public Nullable&lt;int&gt; dpc_id_theme { get; set; }
    public int dpc_id_animateur_fk { get; set; }
    public Nullable&lt;System.DateTime&gt; dpc_date_creation { get; set; }
    public Nullable&lt;System.DateTime&gt; dpc_date_fin { get; set; }
    public Nullable&lt;System.DateTime&gt; dpc_date_engag_anim { get; set; }
    public Nullable&lt;bool&gt; dpc_flg_let_engag_anim { get; set; }
    public Nullable&lt;bool&gt; dpc_flg_fsoins_anim { get; set; }
    public virtual ICollection&lt;ass_reunion_participant&gt; ass_reunion_participant { get; set; }
    public virtual theme_dpc theme_dpc { get; set; }
    public virtual gdp_groupe_de_pair gdp_groupe_de_pair { get; set; }
    public virtual ICollection&lt;dpc_participant&gt; dpc_participant { get; set; }
    public virtual ICollection&lt;dpc_reunion&gt; dpc_reunion { get; set; }
}
</code></pre>

<p>I understood this :</p>

<ol>
<li><p><strong>For Lazy loading</strong> : because the load is lazy, if I call the dbset <code>dpc_gestion</code> all navigation properties <strong>won't</strong> be loaded. This type of loading is the best in performance and responsiveness. It is enabled by default and If I'd like to re-enable it I have to set :</p>

<pre><code>context.Configuration.ProxyCreationEnabled = true;    
context.Configuration.LazyLoadingEnabled = true;
</code></pre></li>
<li><p><strong>For the eager loading</strong>
It is not lazy: it loaded all navigation properties when I load <code>dpc_gestion</code>. The navigation properties can be loaded using <code>include</code> method. To enable this loading type :</p>

<pre><code>context.Configuration.LazyLoadingEnabled = false;
</code></pre></li>
<li><p><strong>For the explicit loading</strong>
It is like the eager loading but we use <code>Load</code> method instead of <code>include</code>.</p></li>
</ol>

<p>So I'd like to know :</p>

<ol>
<li>If this small resume is true ?</li>
<li>If it is true, what is the difference between eager and explicit loading?</li>
<li>If I Use <strong>lazy loading</strong> and I call for example <code>dpc_gestion.dpc_participant</code>, does the navigation properties loads?or I will get an exception?</li>
<li>Is there a case when eager loading or explicit loading were better than lazy loading in performance and responsiveness?</li>
</ol>

<p>Thanks</p>