我正在尝试使用ODP.net在Oracle下使用EF CodeFirst.这是我的DbContext类:
public class MyCEContext : DbContext { public DbSet<Person> Persons { get; set; } protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Entity<Person>().ToTable("PERSONS","myce"); } public MyCEContext() : base(new OracleConnection( "Data Source=cebd; User ID=myce; Password=****;"),true) {} }
问题是,当我尝试做这样的事情时:
MyCEContext context = new MyCEContext(); Person p = context.Persons.Find(1);
我得到这个内心的错误:
{"ORA-00942: table or view does not exist"}
表格存在.
我究竟做错了什么?