title: Linq to Entities: NullReferenceException on a simple select
body: <p>I have the following sentence:</p>
  
  <pre><code>var customers = from customer in Context.ps_customer
                  select customer;
  </code></pre>
  
  <p>As you can see, it is the most simple sentence in the world. Well, it throws a NullReferenceException, and I don't have any idea why. in fact, the exception is thrown at </p>
  
  <pre><code>List&lt;ps_customer&gt; clientes = customers.ToList&lt;ps_customer&gt;();
  </code></pre>
  
  <p>but if I set a breakpoint in the Linq sentence and try to see the customers value, I have the NullReferenceException.</p>
  
  <p>Does anyone have any idea why I get this exception?</p>
  
  <p><strong>EDIT</strong>: I am going to provide a bit more information:</p>
  
  <pre><code>MyEntityModel Context = new MyEntityModel();
  
  var solicitudes = from  solicitud in Context.ps_orders
                    where solicitud.date_add.Year == fecha.Year &amp;&amp;
                          solicitud.date_add.Month == fecha.Month &amp;&amp;
                          solicitud.date_add.Day == fecha.Day
                    select solicitud;
  
  //This return correct data
  ps_orders orden = solicitudes.ToList&lt;ps_orders&gt;().FirstOrDefault(); 
  
  var customers = from customer in Context.ps_customer
                  where customer.id_customer == orden.id_customer
                  select customer;
  
  var orden_detalles = from oDetalle in Context.ps_order_detail
                       where oDetalle.id_order == orden.id_order
                       select oDetalle;
  
  var direcciones = from oDireccion in Context.ps_address
                    where oDireccion.id_address == orden.id_address_delivery
                    select oDireccion;
  
  ps_address direccion = direcciones.FirstOrDefault(); //Correct data
  List&lt;ps_order_detail&gt; detalles = orden_detalles.ToList&lt;ps_order_detail&gt;(); //Correct data
  ps_customer clientes = customers.FirstOrDefault(); //NullReferenceException
  </code></pre>
  
  <p>I am totally sure that ps_customer has data, 2 rows to be specific, and I have deleted the ps_customer entity from the .edmx and I have added it again, an it still happens</p>
  
  <p>Thank you very much!</p>
  
  <p><strong>EDIT 2:</strong>
  I have copied the create statement of the table, created a new table called customerTwo, inserted new data, and it still fails... By the way, I am using MySQL, and the DataBase is created by Prestashop, just in case that information is useful...</p>