Print Page | Close Window

Can't return boolean or int (scalar values) from stored procedure Error in object mapper tool: TypeName does not contain namespace when adding stored procedure

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=1259
Printed Date: 08-May-2024 at 5:56am


Topic: Can't return boolean or int (scalar values) from stored procedure Error in object mapper tool: TypeName does not contain namespace when adding stored procedure
Posted By: adam
Subject: Can't return boolean or int (scalar values) from stored procedure Error in object mapper tool: TypeName does not contain namespace when adding stored procedure
Date Posted: 14-May-2009 at 12:08pm
Hi,
 
We've just added our first stored procedure to our edmx file (we used the "function import" feature and set the return type to Boolean). It is a fairly straightforward stored proc that returns a single column and single row (i.e., a scalar value). The value in that one column is a boolean (bit). The .edmx file translates this into a return type of Collection(Boolean) when we look at the xml... When saving the .edmx, we said "OK" to update our DevForce model.
 
Next, we open our DevForce EF Object Mapper tool and click save, and we get the following error:
 
"Failed to save model file:  'C:\... [foo].ibedmx'
TypeName: 'Boolean' does not contain namespace: '[blah]'
 
It's as if the DevForce object mapper tool does not know what to do with a return type of Collection(Boolean). We get the same error when we change the return type to Int32 (or any built in System type).
 
When we change the return type to be one of our custom Entity types, the DevForce EF Object Mapper tool is happy.
 
Does this mean that DevForce does not support returning built in types (such as boolean and int32) from stored procedures????! Could this be?
 
Adam :)
 
 



Replies:
Posted By: adam
Date Posted: 14-May-2009 at 12:40pm
(to be fair, I just checked the designer.cs file that the .edmx creates, and it seems to ignore creating any code when the return type is a built in type! When I change the return type of the "function import" to be a custom entity type, it generates code in the edmx designer.cs file [and likewise in the dev force designer.cs file]. Does this mean that built-in types from stored procedures are not supported by Microsoft Entity Framework too????) Adam :)


Posted By: kimj
Date Posted: 14-May-2009 at 6:41pm
Currently, neither the Entity Framework nor DevForce supports returning scalars or primitive (built-in) types from a stored procedure.  The DevForce error is unfortunately a little misleading, but if it generated successfully you would still get an error at run time.
 
EF 4.0 (and therefore DevForce.vNext) will support scalar and primitive return types. 
 



Print Page | Close Window