Code first with CTP5 error??

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
stienessen
Posts: 1
Joined: Thu 27 Jan 2011 14:54

Code first with CTP5 error??

Post by stienessen » Thu 27 Jan 2011 15:12

I'm attempting to create a code-first model to support both Oracle and SQL Server - I have the SQL side working, however with an eval of the devart provider I'm getting the following with Oracle... any ideas what I'm doing wrong?

The server encountered an error processing the request. The exception message is 'Schema specified is not valid. Errors: (8,6) : error 0040: The Type varchar2 is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification. (9,6) : error 0040: The Type varchar2 is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification. (10,6) : error 0040: The Type varchar2 is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification. (11,6) : error 0040: The Type date is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification. (19,6) : error 0040: The Type varchar2 is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification. (20,6) : error 0040: The Type varchar2 is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification. (21,6) : error 0040: The Type date is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification. (28,6) : error 0040: The Type varchar2 is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification. (29,6) : error 0040: The Type varchar2 is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification. (30,6) : error 0040: The Type blob is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification. (31,6) : error 0040: The Type varchar2 is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification. (32,6) : error 0040: The Type date is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification. (40,6) : error 0040: The Type varchar2 is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification.'. See server logs for more details. The exception stack trace is:

at System.Data.Metadata.Edm.StoreItemCollection.Loader.LoadItems(IEnumerable`1 xmlReaders, IEnumerable`1 sourceFilePaths) at System.Data.Metadata.Edm.StoreItemCollection.Init(IEnumerable`1 xmlReaders, IEnumerable`1 filePaths, Boolean throwOnError, DbProviderManifest& providerManifest, DbProviderFactory& providerFactory, String& providerManifestToken, Memoizer`2& cachedCTypeFunction) at System.Data.Metadata.Edm.StoreItemCollection..ctor(IEnumerable`1 xmlReaders) at System.Data.Entity.ModelConfiguration.Edm.Db.DbDatabaseMetadataExtensions.ToStoreItemCollection(DbDatabaseMetadata database, Action`1 storeAction) at System.Data.Entity.ModelConfiguration.Edm.Db.Mapping.DbDatabaseMappingExtensions.ToMetadataWorkspace(DbDatabaseMapping databaseMapping, Action`1 storeAction) at System.Data.Entity.Internal.CodeFirstCachedMetadataWorkspace.GetMetadataWorkspace(DbConnection connection) at System.Data.Entity.Infrastructure.DbModel.CreateObjectContext[TContext](DbConnection existingConnection) at System.Data.Entity.Internal.LazyInternalContext.InitializeContext() at System.Data.Entity.Internal.LazyInternalContext.get_ObjectContext() at AmCom.Services.Model.Meta.TenantModel.op_Implicit(TenantModel ctx) in C:\Users\daves\Documents\Visual Studio 2010\Projects\DataServicesWebApp\AmCom.Services.Model\Meta\TenantModel.cs:line 49 at WcfService1.TenantService.CreateDataSource() in C:\Users\daves\Documents\Visual Studio 2010\Projects\DataServicesWebApp\WcfService1\TenantService.svc.cs:line 41 at System.Data.Services.DataService`1.CreateProvider() at System.Data.Services.DataService`1.HandleRequest() at System.Data.Services.DataService`1.ProcessRequestForMessage(Stream messageBody) at SyncInvokeProcessRequestForMessage(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)

Remco Blok
Posts: 25
Joined: Tue 14 Dec 2010 12:34

Post by Remco Blok » Thu 27 Jan 2011 16:28

this will solve that

modelBuilder.Conventions.Remove();

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Fri 28 Jan 2011 11:40

Remco Blok, thank you for sharing your knowledge.
This is absolutely correct, removing this convention should solve the problem.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 02 Mar 2011 11:58

We have posted an article about CTP 5 support in our blog. It contains some information about Code First and Database creation, and some samples as well.

Post Reply