Thx, that was indeed the problem!
Now I get an exception when trying to generate the following model when calling 'CreateDatabaseScript'
Code: Select all
public class SomeContext : DbContext
{
public DbSet<User> Users { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<SpecialUser>().ToTable("UserSpecial");
}
}
public abstract class User
{
public int Id { get; set; }
}
public class SpecialUser : User
{
public List<Country> Countries { get; set; }
}
public class Country
{
public int Id { get; set; }
}
The exception is a 'NullReferenceException'. Note that the same model with SQL Server doesn't generate an error. Also when I comment the line below it works.
Code: Select all
modelBuilder.Entity<SpecialUser>().ToTable("UserSpecial");
The exception generated by 'CreateDatabaseScript' is
Code: Select all
System.NullReferenceException was unhandled
HResult=-2147467261
Message=Object reference not set to an instance of an object.
Source=Devart.Data.Oracle.Entity
StackTrace:
at Devart.Common.Entity.es.b(ReferentialConstraint A_0)
at Devart.Common.Entity.es.c(ReferentialConstraint A_0)
at Devart.Common.Entity.es.a(ReferentialConstraint A_0, EntitySet A_1, EntitySet A_2)
at Devart.Data.Oracle.Entity.a3.a(ReferentialConstraint A_0, EntitySet A_1, EntitySet A_2)
at Devart.Common.Entity.es.a(AssociationSet A_0)
at Devart.Common.Entity.es.t()
at Devart.Common.Entity.es.u()
at Devart.Common.Entity.es.am()
at Devart.Data.Oracle.Entity.OracleEntityProviderServices.DbCreateDatabase(DbConnection connection, Nullable`1 commandTimeout, StoreItemCollection storeItemCollection)
at System.Data.Entity.Core.Common.DbProviderServices.CreateDatabase(DbConnection connection, Nullable`1 commandTimeout, StoreItemCollection storeItemCollection)
at System.Data.Entity.Core.Objects.ObjectContext.CreateDatabase()
at System.Data.Entity.Internal.DatabaseOperations.Create(ObjectContext objectContext)
at System.Data.Entity.Internal.DatabaseCreator.CreateDatabase(InternalContext internalContext, Func`3 createMigrator, ObjectContext objectContext)
at System.Data.Entity.Internal.InternalContext.CreateDatabase(ObjectContext objectContext)
at System.Data.Entity.Database.Create(Boolean skipExistsCheck)
at System.Data.Entity.Database.Create()
at System.Data.Entity.DropCreateDatabaseAlways`1.InitializeDatabase(TContext context)
at System.Data.Entity.Internal.InternalContext.<>c__DisplayClasse`1.<CreateInitializationAction>b__d()
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
at System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c)
at System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)
at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action)
at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase()
at System.Data.Entity.Internal.InternalContext.Initialize()
at System.Data.Entity.Internal.InternalContext.ForceOSpaceLoadingForKnownEntityTypes()
at System.Data.Entity.DbContext.System.Data.Entity.Infrastructure.IObjectContextAdapter.get_ObjectContext()
at ConsoleApplication1.Program.Main(String[] args) in c:\WorkZone\Repositories\BeCert\src\ConsoleApplication1\Program.cs:line 24
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: