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.
My class:
[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; }
}
Context
public DbSet<AgentCallsByPartnerModel> AgentCallsByPartner { get; set; }
And this is my table
But when I try to get users from the database, I get an exception
DbContext has changed since the database was created....
So what is my mistake? Thanks
