title: Improving Linq to entities query with not mapped properties
body: <p>I'm having lot of problems to get the a query properly built before sending it to the server to retrieve filtered results, fisrt i was querying against a hole result set of orders then appliying a order items filter with a calculated property, when trying to refactor to get only the set of orders matching the items criteria, of course i'm getting the error: The specified type member 'ReceivableQuantity' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported. 
  Below the working code:</p>
  
  <pre><code>pendingOrders = from o in this.GetAll()
                  where o.OrderItems.Where(i =&gt; i.ReceivableQuantity &gt; 0).Count() &gt; 0
                  select new Order()
                  {
                         OrderNumber = o.OrderNumber,
                         Comments = o.Comments,
                         FinalApprover = o.FinalApprover,
                         OrderDate = o.OrderDate,
                         Requisitioner = o.Requisitioner,
                         SupplierName = o.SupplierName,
                         ID = o.ID,
                         ShoppingCartName = o.ShoppingCartName,
                         OrderItems = (from i in o.OrderItems 
                                       where i.ReceivableQuantity &gt; 0
                                       select i).OrderBy(i =&gt; i.LineNumber).ToList()
                  };
  </code></pre>
  
  <p>This is the NotMapped Property in the OrderItem Class:</p>
  
  <pre><code>    [NotMapped]
      public decimal ReceivableQuantity
      {
          get
          {
              if (Order == null)
                  return 0;
  
              decimal response;
              response = this.MatchedQuantity - this.ReceivedQuantity;
  
              if (response &gt;= 0)
                  return response;
              else
                  throw new ArgumentOutOfRangeException("Receivable Quantity must be greater than 0.");
          }
      }
  </code></pre>
  
  <p>MatchedQuantity and ReceivedQuantity are also NotMapped properties, so i think this is really extending.</p>
  
  <p>What's the best approach i shoud use, now that the site using it is already running, and with the database growing everyday the features using the code are becoming realy slow.</p>
  
  <p>Thanks in advance for your help.
  Lio.</p>