I have a project where i use EF 4.1.
At Data Context:
public DbSet<Customer> Customer { get; set; }
protected override void OnModelCreating(System.Data.Entity.ModelConfiguration.ModelBuilder modelBuilder) { }
Entity model class:
[Table("User",SchemaName="dbo")]
public class User{
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
Once I run the application I was getting following error.
Invalid object name dbo.User
Why? What is wrong?
What is in your OnModelCreating method?
Try to remove default plural table name: