ProviderIncompatibleException与实体框架4 ctp5和oracle express

时间:2011-01-20 19:53:49

标签: oracle entity-framework-4 oracle-xe entity-framework-ctp5 devart

当我尝试使用dotConnect for Oracle和实体框架4 ctp5连接Oracle Express数据库时遇到了ProviderIncompatibleException。我有Oracle Express 10g,今天我下载了Oracle Express的试用版,所以我的版本号为6.0.86.0的dll

这是我的配置。知道如何解决问题吗?

   

1 个答案:

答案 0 :(得分:0)

我们已在论坛here回复了您 代码示例:
    public class MyOracleContext:DbContext {

  public DbSet<Product> Products { get; set; } 
  public DbSet<ProductCategory> ProductCategories { get; set; } 

  static MyOracleContext() { 

    System.Data.Entity.Database.DbDatabase.SetInitializer<MyOracleContext>(null); 
  } 

  protected override void OnModelCreating(ModelBuilder modelBuilder) { 

    base.OnModelCreating(modelBuilder); 

    modelBuilder.Conventions.Remove<System.Data.Entity.ModelConfiguration.Conventions.Edm.Db.ColumnTypeCasingConvention>(); 
  } 
}