title: Invalid column name ProveedoresID and UsuarioID on ASP.NET MVC 3 web app using Entity Framework Code First
body: <p>I am currently making a web app for MVC 3 using Entity Framework but I'm a beginner and I can't make the Code First mapping work properly and for some reason my Visual Studio doesn't have Database First and Model First functionality.
  I have three model classes: Contacto, Proveedor and Usuario, each one of them corresponding to a table on an database existing database and I want to make those classes with Code First to map to this database. Contacto has a one-to-one relationship with Proveedor and Usuario. I declared the model classes like this:</p>
  
  <pre><code>public class Contacto 
  {
      public int ID { get; set; }
      public string Nombre { get; set; }
      public string Telefono { get; set; }
      public Proveedor ProveedorID { get; set; }
      public Usuario UsuarioID { get; set; }
  }
  
  public class Proveedor 
  {
      public short ID { get; set; }
      public string NombreProveedor {get;set;}
  }
  
  public class Usuario 
  {
      public short ID { get; set; }
      public string NombreUsuario {get;set;}
  }
  </code></pre>
  
  <p>The context class is the following:</p>
  
  <pre><code> public class Contexto : DbContext 
  {
      public DbSet&lt;Contacto&gt; Contactos { get; set; } 
   public DbSet&lt;Proveedor&gt; Proveedores { get; set; } 
   public DbSet&lt;Usuarios&gt; Usuarios { get; set; } 
  }
  </code></pre>
  
  <p>I made a controller and view with CRUD methods but when the code gets to the EditorFor for the <code>Proveedor</code> attribute in <code>Contacto</code> I get a Invalid column name 'ProveedorID' and the same for UsuarioID. Changing the table names on the existing database doesn't fix this but sometimes makes the Invalid column name error refer to Contacto_ID instead of ProveedorID.
  How do I make the reference to the Proveedor and Usuario model in Contacto work? And how override the automatic table mapping and specify the mapping manually? The name conventions don't work well in Spanish and don't detect properly that there is a relationship in a database.</p>