title: System.Data.Entity.Core.MetadataException: 'Schema specified is not valid.
body: <p>I'm creating a login window and problem appears when pressing submit button after entering wrong credentials.
  Here is my view</p>
  
  <pre><code>@model ProjectyMcProjectface.Models.RegisteredUser
  &lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta name="viewport" content="width=device-width" /&gt;
      &lt;title&gt;Login page&lt;/title&gt;
      @Styles.Render("~/Content/LoginVisuals")
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div id="LoginWrapper"&gt; 
          @using (Html.BeginForm("Authorize", "Login",FormMethod.Post))
          {
              &lt;table id="LoginTable"&gt;
                  &lt;tr&gt;
                      &lt;td&gt;@Html.LabelFor(model =&gt; model.UserName)&lt;/td&gt;
                      &lt;td&gt;@Html.EditorFor(model =&gt; model.UserName)&lt;/td&gt;
                  &lt;/tr&gt;
  
                  &lt;tr&gt;
                      &lt;td&gt;&lt;/td&gt;
                      &lt;td&gt;@Html.ValidationMessageFor(model =&gt; model.UserName)&lt;/td&gt;
                  &lt;/tr&gt;
  
                  &lt;tr&gt;
                      &lt;td&gt;@Html.LabelFor(model =&gt; model.PassWord)&lt;/td&gt;
                      &lt;td&gt;@Html.EditorFor(model =&gt; model.PassWord)&lt;/td&gt;
                  &lt;/tr&gt;
  
                  &lt;tr&gt;
                      &lt;td&gt;&lt;/td&gt;
                      &lt;td&gt;@Html.ValidationMessageFor(model =&gt; model.PassWord)&lt;/td&gt;
                  &lt;/tr&gt;
  
                  &lt;tr&gt;
                      &lt;td colspan="2"&gt;&lt;label class="field-validation-error"&gt;@Html.DisplayFor(model =&gt; model.LoginErrorMessage)&lt;/label&gt;&lt;/td&gt;
                  &lt;/tr&gt;
  
                  &lt;tr&gt;
                      &lt;td&gt;&lt;/td&gt;
                      &lt;td&gt;
                      &lt;input type="submit" value="Login" /&gt;
                      &lt;input type="reset" value="Clear" /&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
  
              &lt;/table&gt;
          }
      &lt;/div&gt;
  
      @Scripts.Render("~/bundles/ValidationScripts")
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>my registered user model </p>
  
  <pre><code>public partial class RegisteredUser
      {
          public int Id { get; set; }
  
          [DisplayName("User Name")]
          [Required(ErrorMessage = "This field is required to be filled")]
          public string UserName { get; set; }
  
          [DataType(DataType.Password)]
          [DisplayName("Password")]
          [Required(ErrorMessage = "This field is required to be filled")]
          public string PassWord { get; set; }
  
          public string LoginErrorMessage { get; set; }
      }
  </code></pre>
  
  <p>and my login controller</p>
  
  <pre><code>[HttpPost]
  public ActionResult Authorize(ProjectyMcProjectface.Models.RegisteredUser userModel)
  {
      using (InternalDBEntities1 db = new InternalDBEntities1())
      {
          var userDetails = db.RegisteredUsers.Where(x =&gt; x.UserName == userModel.UserName &amp;&amp; x.PassWord == userModel.PassWord).FirstOrDefault();
          if (userDetails == null)
          {
              userModel.LoginErrorMessage = "Your password or user name is incorrect";
              return View("Index", "Login", userModel);
          }
  
      }
  
          return View();
  }
  </code></pre>
  
  <p>the error fires in line</p>
  
  <pre><code>var userDetails = db.RegisteredUsers.Where(x =&gt; x.UserName == userModel.UserName &amp;&amp; x.PassWord == userModel.PassWord).FirstOrDefault();
  </code></pre>
  
  <p>and says </p>
  
  <blockquote>
    <p>The mapping of CLR type to EDM type is ambiguous because multiple CLR
    types match the EDM type 'RegisteredUser'. Previously found CLR type
    'ProjectyMcProjectface.RegisteredUser', newly found CLR type
    'ProjectyMcProjectface.Models.RegisteredUser'.'</p>
  </blockquote>
  
  <p>How can I solve this?</p>