title: Map a Dictionary in Entity Framework Code First Approach
body: <p>I have a dictionary like this:</p>
  
  <pre><code>/// &lt;summary&gt;
  /// Gets the leave entitlement details.
  /// &lt;/summary&gt;
  /// &lt;value&gt;The leave entitlement details.&lt;/value&gt;
  public Dictionary&lt;string, EmployeeLeaveEntitlement&gt; LeaveEntitlementDetails { get; set; }  
  </code></pre>
  
  <p>And I want to map it to the database. Is it possible to use a protected or private List&lt;> for that? such as:</p>
  
  <pre><code>/// &lt;summary&gt;
  /// Gets the leave entitlement details.
  /// &lt;/summary&gt;
  /// &lt;value&gt;The leave entitlement details.&lt;/value&gt;
  public Dictionary&lt;string, EmployeeLeaveEntitlement&gt; LeaveEntitlementDetails { get; set; } 
  
  public List&lt;EmployeeLeaveEntitlement&gt; LeveEntitlementStore
  {
      get
      {
          List&lt;EmployeeLeaveEntitlement&gt; leaveEntitlements = new List&lt;EmployeeLeaveEntitlement&gt;();
  
          foreach (KeyValuePair&lt;string, EmployeeLeaveEntitlement&gt; leaveType in LeaveEntitlementDetails)
          {
              leaveEntitlements.Add(leaveType.Value);
          }
  
          return leaveEntitlements;
      }
      set
      {
          foreach (EmployeeLeaveEntitlement item in value)
          {
              this.LeaveEntitlementDetails.Add(item.LeaveType, item);
          }
      }
  }
  </code></pre>
  
  <p>Can anyone help me?</p>