title: Simple LINQ select (using Entity Framework) does not return values
body: <p>I am new at C# and Entity Framework. My LINQ select never returns a value from my Entity Editor. I have a table called <strong>Editor</strong> with this data:</p>
  
  <pre><code>Editor
  ---------------------------------
  Id |  Name    | Email 
  1  |  Oreilly | oreilly@email.com
  2  |  Apress  | apress@email.com
  3  |  Abril   | abril@email.com
  4  |  Europa  | europa@email.com
  </code></pre>
  
  <p>The <em>connection string</em> on my <strong>Web.Config</strong> is:</p>
  
  <pre><code>  &lt;connectionStrings&gt;
      &lt;add name="EditoraContext" providerName="System.Data.SqlClient" connectionString="Server=.\SQLEXPRESS;Database=livraria;
           uid=sa;pwd=sa;Trusted_Connection=true;Integrated Security=True;MultipleActiveResultSets=True"/&gt;
    &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>In the folder <strong>Models</strong> in my project I have class <strong>Editora</strong> as below:</p>
  
  <pre><code> namespace LivrariaVirtual.Models
  {
      public class Editora
      {
          public int Id { get; set; }
          public string Nome { get; set; }
          public string Email { get; set; }
          public virtual ICollection&lt;Livro&gt; Livros { get; set; }
  
      }
  }
  </code></pre>
  
  <p>I have a class <strong>LivrariaVirtualContext</strong> to keep the diferent <em>DbContexts</em>:</p>
  
  <pre><code>namespace LivrariaVirtual.Models
  {
      public class LivrariaVirtualContext : DbContext
      {
          public DbSet&lt;Editora&gt; Editoras { get; set; }
          public DbSet&lt;Livro&gt; Livros { get; set; }
      }
  }
  </code></pre>
  
  <p>I have a class named <strong>EditoraRepository</strong> that has a method <strong>FetchAll</strong> that should return all records from the table <strong>Editoras</strong>:</p>
  
  <pre><code>namespace LivrariaVirtual.Models
  {
      public class EditoraRepository
      {
  
          private LivrariaVirtualContext context = new LivrariaVirtualContext();
  
          public List&lt;Editora&gt; FetchAll()
          {
              var consulta = from e in context.Editoras
                             select e;            
              return consulta.ToList();
          }
      }
  }
  </code></pre>
  
  <p>I use this method <strong>FetchAll</strong> on my controller, but it doesn't return anything.  Here is my controller <strong>EditorasController</strong>:</p>
  
  <pre><code>namespace LivrariaVirtual.Controllers
  {
      public class EditorasController : Controller
      {
          //
          // GET: /Editoras/
  
          public ActionResult Index()
          {
              var editoraRepository = new EditoraRepository();                                    
              return View(editoraRepository.FetchAll());
          }
  
      }
  }
  </code></pre>
  
  <p>I have tried to debug using a variable called <strong>test</strong> using a break point.</p>
  
  <pre><code>namespace LivrariaVirtual.Controllers
  {
      public class EditorasController : Controller
      {
          //
          // GET: /Editoras/
  
          public ActionResult Index()
          {
              var editoraRepository = new EditoraRepository();
              var teste = editoraRepository.FetchAll();
              return View(editoraRepository.FetchAll());
          }
  
      }
  }
  </code></pre>
  
  <p>The value of <em>test</em> is: <strong>Count = 0</strong>.</p>
  
  <p>Can somebody help me here?</p>