title: Using helper methods in Entity Framework query
body: <p>Using our previous ORM, <code>OpenAccess</code>, we were able to include helper methods in the select statements of our queries. For example, to combine SQL data with cached application data.</p>
  
  <p>After switching to Entity Framework 6.x we're getting errors like this:</p>
  
  <blockquote>
    <p>LINQ-to-Entities does not recognize the method 'System.String GetProductTranslation'</p>
  </blockquote>
  
  <p>The ling query looks like this:</p>
  
  <pre><code>var products = (from p in db.Products
                  join cp in db.CustomerPrices on p.ProductId equals cp.ProductId
  
                  where p.LockedSince.Equals(null)
                  &amp;&amp; ... etc etc etc
  
                  select new
                  {
                      ProductId = p.ProductId,
                      Name = TranslationHelper.GetProductTranslation(p.ProductId, ProductTranslationField.Name, p.Name),
                      Description2 = TranslationHelper.GetProductTranslation(p.ProductId, ProductTranslationField.Description2, p.Description2),
                      Description3 = TranslationHelper.GetProductTranslation(p.ProductId, ProductTranslationField.Description3, p.Description3),
                      Description4 = TranslationHelper.GetProductTranslation(p.ProductId, ProductTranslationField.Description4, p.Description4),
                      ... etc etc etc
                  });
  </code></pre>
  
  <p>In this case the <code>GetProductTranslation</code> method grabs translation data from the application cache to prevent using endless amounts of joins and stress on the database.</p>
  
  <p>What would be the best way to replicate this using Entity Framework 6.x?</p>