title: Map model to existing database table using Entity Framework
body: <p>I face some difficulties when attempt to map my class to existing table using Entity Framework. I currently using Code first but a table was created without it and i cannot map it to a model a created.</p>
  
  <p>My class:</p>
  
  <pre><code> [Table("AgentCallsByPartner")]
  public class AgentCallsByPartnerModel
  {
      [Key]
      public int AgentCallID { get; set; }
  
      [Required]
      public DateTime CallDate { get; set; }
  
      public string CustomerID { get; set; }
  
      public string AgentNo { get; set; }
  
      public string AccountCreated { get; set; }
  
      public string QuoteStarted { get; set; }
  
      [Required]
      public string GroupName { get; set; }
  
      [Required]
      public string GroupRollup { get; set; }
  
  }
  </code></pre>
  
  <p>Context</p>
  
  <pre><code>    public DbSet&lt;AgentCallsByPartnerModel&gt; AgentCallsByPartner { get; set; }
  </code></pre>
  
  <p>And this is my table</p>
  
  <p><a href="https://i.stack.imgur.com/ToNmF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ToNmF.png" alt="enter image description here"></a></p>
  
  <p>But when I try to get users from the database, I get an exception</p>
  
  <p>DbContext has changed since the database was created....</p>
  
  <p>So what is my mistake? Thanks</p>