title: Passing wrong model item to view
body: <p>I'm trying to use two tables in the same View in my <code>asp.net mvc</code> project but I'am doing some errors and I get this error:</p>
  <blockquote>
  <p>System.InvalidOperationException: The model item passed into the dictionary is of type 'System.Data.Entity.Infrastructure.DbQuery<code>1[Question]</code>, but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable<code>1[projet.Models.userdbcontext]</code></p>
  </blockquote>
  <p>Class <code>Questions.cs</code>:</p>
  <pre><code>public class Question
      {
          public int Id { get; set; }
          public int userID { get; set; }
              
      }
  </code></pre>
  <p>Class <code>User.cs</code>:</p>
  <pre><code>public class User
      {
          
  
          public int Id { get; set; }
          public string Email { get; set; }
          public string Password { get; set; }
          public string Name { get; set; }
      }
  </code></pre>
  <p>Model <code>userdbcontext.cs</code>:</p>
  <pre><code>{
          public userdbcontext()
          { }
          public DbSet&lt;Question&gt; Questiondb { get; set; }
          public DbSet&lt;User&gt; Usersdb { get; set; }
      }
  </code></pre>
  <p>and this is the controller:</p>
  <pre><code> private userdbcontext db = new userdbcontext();
          // GET: question
          public ActionResult Index()
          {
              var l = from e in db.Questiondb
                      select e;
              return View(l);
          }
  </code></pre>
  <p>The view:</p>
  <pre><code>@model IEnumerable&lt;projet.Models.userdbcontext&gt;
  </code></pre>