title: A lambda expression with a statement body cannot be converted to an expression tree in nopCommerce
body: <p>I try to create a linq join query in the nopCommerce 3.0. i join two table in linq and write</p>
  
  <p>the code successfully. but the visual studio intellicence shows the error like </p>
  
  <p><strong>A lambda expression with a statement body cannot be converted to an expression tree</strong></p>
  
  <p>please see my code below</p>
  
  <pre><code> var roles = _customerEventRoleRepository.Table.Where(c =&gt; c.EventId == selevent)
                     .Join
                     (
                        _customerRepository.Table,
                        cev =&gt; cev.CustomerId, c =&gt; c.Id,
                        (cev, c) =&gt;
                        {                             
                            var cust = new CustomerEventRolesModel();
  
                            cust.Id = cev.Id;
                            cust.CustomerId = c.Id;
                            cust.Customer = c.Email;
                            cust.ContactName = c.GetAttribute&lt;string&gt;(SystemCustomerAttributeNames.FirstName);
                            cust.CompanyName = c.GetAttribute&lt;string&gt;(SystemCustomerAttributeNames.Company);
                            cust.Speaker = cev.IsSpeaker;
                            cust.Sponsor = cev.IsSponser;
  
                            return cust;
                        }
                      ).OrderBy(cev =&gt; cev.Customer).ToList();
  </code></pre>
  
  <p>but the error shows </p>
  
  <p><img src="https://i.stack.imgur.com/TUQ1d.jpg" alt="enter image description here"></p>
  
  <p>please help</p>