System.Data.Entity.Core.MetadataException: Schema specified is not valid

c# devart ef-code-first entity-framework-6

Question


I tried to add a db-Migration to my solution. But it quit with the folloing error:

System.Data.Entity.Core.MetadataException: Schema specified is not valid. Errors: 
(0,0) : error 0040: The Type NVARCHAR2 is not qualified with a namespace or alias. Only primitive types can be used without qualification.
(0,0) : error 0040: The Type TIMESTAMP is not qualified with a namespace or alias. Only primitive types can be used without qualification.
(0,0) : error 0040: The Type NCLOB is not qualified with a namespace or alias. Only primitive types can be used without qualification.
... (more errors are following)

Here is my DbMigrationsConfiguration:

using System.Data.Entity.Migrations;
using Devart.Data.Oracle.Entity.Migrations;

namespace ProductInformation.Migrations
{
    public sealed class Configuration : DbMigrationsConfiguration<ProductInformationContext>
    {
        public Configuration()
        {
            AutomaticMigrationsEnabled = true;
            SetSqlGenerator(OracleConnectionInfo.InvariantName,
                new OracleEntityMigrationSqlGenerator());
        }

        protected override void Seed(ProductInformationContext context)
        {
        }
    }
}

And my DbContext:

using System.Data.Entity;

namespace ProductInformation
{
    public sealed class ProductInformationContext : DbContext
    {
        static ProductInformationContext()
        {
            var config = Devart.Data.Oracle.Entity.Configuration.OracleEntityProviderConfig.Instance;
            config.CodeFirstOptions.RemoveSchemaFromDefaultConstraintName = true;
            config.CodeFirstOptions.TruncateLongDefaultNames = true;
            config.Workarounds.IgnoreDboSchemaName = true;
            config.DmlOptions.BatchUpdates.Enabled = true;
        }

        public ProductInformationContext()
            : base("name=ProductInformationConnectionString")
        {
        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Price>().Property(p => p.Value).HasPrecision(8, 2);
        }

        // some other DbSet

        public DbSet<Price> Prices { get; set; }
    }
}

I have no clue where the error comes from and how to get it solved. I already tried the ColumnTypeCasingConventionCompatibility setting but it didn't solved the errors.

dotConnect for Oracle 9.5.454.0
EF 6.2.0
.NET 4.6.1
oracle 12c

1
0
4/10/2018 3:21:24 PM

Popular Answer

You generated model mapping using Entity Developer and its DbContext template, didn't you? Please set Fluent Mapping = True (in DbContext template's properties) and Metadata Artifact Processing = Do Not Generate Mapping Files (in Model Settings), save the model and rebuild the project. Does it work this way?

0
4/10/2018 6:16:37 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow