title: Cannot implicitly convert type 'System.Collections.Generic.List error
body: <p>Does any know why I am getting this error when trying to edit something in the database through the ForestLogisticBEAN class?</p>
  
  <blockquote>
    <p>Cannot implicitly convert type
    'System.Collections.Generic.List to
    'System.Linq.IQueryable'.
    An explicit conversion exists (are you missing a cast?)</p>
  </blockquote>
  
  <p>Here is the integration layer:</p>
  
  <pre><code>public void EditParcelDetail(ForestLogisticBEAN parcel){
  
      IQueryable&lt;ForestLogisticBEAN&gt; _ForestLogisticsBeans;
  
      _ForestLogisticsBeans = (from order in _context.Orders
                from tracking in _context.Trackings
                where order.CustomerID == parcel.Id
                where tracking.CustomerId == parcel.Id
                select new {order.DeliveryDate, order.OrderDate, tracking.Status} ).ToList();
        }
  </code></pre>
  
  <p>Here is the ForestLogisticBEAN class:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  
  namespace ForestLogistic.Data.BEANS
  {
      public class ForestLogisticBEAN
      {
  
          public int TrackingId { get; set; }
          public int OrderId { get; set; }
          public bool Status { get; set; }
          public DateTime OrderDate { get; set; }
          public DateTime DeliveryDate { get; set; }
  
          public ForestLogisticBEAN() { }
      }
  }
  </code></pre>
  
  <p>UPDATE:
  I changed it to List instead of IQueryable but now it is throwing this error instead</p>
  
  <blockquote>
    <p>The model item passed into the dictionary is of type
    'System.Collections.Generic.List`1[ForestLogistics.Data.BEANS.ForestLogisticBEAN]',
    but this dictionary requires a model item of type
    'ForestLogistics.Data.Order'.</p>
  </blockquote>
  
  <p>Here is the new integration layer:</p>
  
  <pre><code>public void EditParcelDetail(ForestLogisticBEAN parcel)
  
          {
  
                  List&lt;ForestLogisticBEAN&gt; _ForestLogisticsBeans;
  
                _ForestLogisticsBeans = (from order in _context.Orders
                                  from tracking in _context.Trackings
  
                                   where order.CustomerID == parcel.Id
                                  where tracking.CustomerId == parcel.Id
                                  select new ForestLogisticBEAN {
                                      DeliveryDate = parcel.DeliveryDate,
                                      OrderDate = parcel.OrderDate,
                                      Status = parcel.Status
  
                                  });
  
                _context.SaveChanges();
  
            }
  </code></pre>
  
  <p>The aim is to be able to combine the order and the tracking table with the bean class</p>