Print Page | Close Window

EntityServerException with Complex Types

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2009
Forum Discription: For .NET 3.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=742
Printed Date: 16-Apr-2024 at 1:59am


Topic: EntityServerException with Complex Types
Posted By: danielp37
Subject: EntityServerException with Complex Types
Date Posted: 25-Mar-2008 at 9:11pm
I am trying to use a complex type in my data model but when I try to query one of the tables with the complex type, I get the following exception:

IdeaBlade.EntityModel.v4.EntityServerException: {"Argument types do not match"}
   at IdeaBlade.EntityModel.v4.EntityManager.HandleEntityServerException(Exception pException, Boolean pTryToHandle, PersistenceOperation pOperation)
   at IdeaBlade.EntityModel.v4.EntityManager.ExecuteServerQuery(IEntityQuery pEntityQuery)
   at IdeaBlade.EntityModel.v4.EntityManager.ExecuteFetch(IEntityFinder finder)
   at IdeaBlade.EntityModel.v4.EntityQueryFinder.Execute()
   at IdeaBlade.EntityModel.v4.EntityManager.ExecuteQueryCore(IEntityQuery query, QueryStrategy strategy)
   at IdeaBlade.EntityModel.v4.EntityManager.ExecuteQuery[T](IEntityQuery query, QueryStrategy strategy, Boolean checkT)
   at IdeaBlade.EntityModel.v4.EntityManager.ExecuteQuery[T](IEntityQuery`1 query)
   at IdeaBlade.EntityModel.v4.EntityQuery`1.GetEnumerator()
   at TestIdeaBlade.IdeaBladeTest.MembersInUtahQuery()

The inner exception is:

System.ArgumentException: {"Argument types do not match"}
   at IdeaBlade.EntityModel.v4.EntityServerProxy.CheckConnection(Exception pException)
   at IdeaBlade.EntityModel.v4.EntityServerProxy.Fetch(SessionBundle pBundle, IEntityQuery pQuery)
   at IdeaBlade.EntityModel.v4.EntityManager.ExecuteServerQuery(IEntityQuery pEntityQuery)

Is this a known limitation of beta1 or is there something that I might be doing wrong?

Thanks,

Dan



Replies:
Posted By: kimj
Date Posted: 26-Mar-2008 at 9:22am
The only problem we're aware of is the code generation problem you reported with using the wrong data types.  Btw, this was just fixed in current bits, and will be included in Beta2.
 
For the complex type in question, can you provide the CSDL, the code generated for it in the Domain Model, AND the code generated for the type in the EF model?  Also, include a snippet of the query you're trying to run.   Thanks!
 
 
 


Posted By: danielp37
Date Posted: 27-Mar-2008 at 10:16pm
http://www.ideablade.com/forum/uploads/temp/20080328_011605_IdeaBladeTestEF.zip - uploads/temp/20080328_011605_IdeaBladeTestEF.zip
 
Attached are the example files that you requested to take a look at.
 
Thanks,
 
Dan


Posted By: kimj
Date Posted: 28-Mar-2008 at 10:35am
Thanks, Dan.
 
It looks like we have another code generation problem with complex types which is causing this error.  We don't generate nullable property types correctly - in this case the DateTime properties within the complex types - and you're seeing an error because these properties are correctly defined in the EF generated code. 
 
I've opened a new bug report for this.


Posted By: danielp37
Date Posted: 02-Apr-2008 at 8:19pm
I have confirmed this.  If I remove the Dates from the complex types and make sure all of the other fields in the types are not nullable, then my complex types work correctly.

Thanks,

Dan


Posted By: kimj
Date Posted: 03-Apr-2008 at 10:15am
Btw, we've already fixed this, and it will be included in Beta2.



Print Page | Close Window