title: Entity Framework - LINQ selection in POCO generic List property
body: <p>I'm having some issues setting a generic list property of a POCO object when from an EF context. For instance I have a very simple object that contains the following:</p>
  
  <pre><code> public class foo
   {
      public string fullName;
      public Entity entity;
      public List&lt;SalesEvent&gt; eventList;
   }
  </code></pre>
  
  <p>My code to populate this object from looks something like this:</p>
  
  <pre><code>  .Select(x =&gt; new foo()
                  {
                      fullName = x.vchFirstName + " " + x.vchLastName,
                      entity = new EntityVo()
                      {
                          address1 = x.vchAddress1,
                          entityId = x.iEntityId,
                          emailAddress = x.vchEmailAddress,
                          firstName = x.vchFirstName,
                          lastName = x.vchLastName,
                          city = x.vchCity,
                          state = x.chState,
                          workNumber = x.vchWorkNumber,
                          mobileNumber = x.vchMobileNumber,
                          siteId = x.iSiteId
  
                      }
                      eventList = _context.Events
                                .Where(e =&gt; e.iEntityId == x.iEntityId
                                          &amp;&amp; e.iStatusId &gt;= eventStatusMin
                                          &amp;&amp; e.iStatusId &lt;= eventStatusMax)
                                .Select(e =&gt; new List&lt;SalesEventMatchVo&gt;
                                             {
                                                 new SalesEventMatchVo()
                                                     {
                                                       vehicleName = _context.Quotes.Select(q=&gt;q).Where(q=&gt;q.iEventId == e.iEventId).FirstOrDefault().vchMake + " " + _context.Quotes.Select(q=&gt;q).Where(q=&gt;q.iEventId == e.iEventId).FirstOrDefault().vchModel,
                                                       eventId =  e.iEventId,
                                                       salesPerson = e.chAssignedTo,
                                                       eventStatusDesc=_context.RefDefinitions.Select(r=&gt;r).Where(r=&gt;r.iParameterId==e.iStatusId).FirstOrDefault().vchParameterDesc,
                                                       eventStatusId =(int)e.iStatusId,
                                                       eventSourceDesc=_context.RefDefinitions.Select(r=&gt;r).Where(r=&gt;r.iParameterId==e.iSourceId).FirstOrDefault().vchParameterDesc,
                                                      createDate = e.dtInsertDate
  
                                                     }
                                             }).FirstOrDefault()
                  }).ToArray();
  </code></pre>
  
  <p>This issue I'm having is that I'm unable to populate the eventList property with all of the events, it's only grabbing the first record(which makes sense looking at the code). I just cant seem to figure out to populate a the entire list.</p>