views:

17

answers:

0

We have two stored procedures in Microsoft SQL Server that return data that is conceptually of the same type. One returns an ID as SCOPE_TDENTITY() (a numeric), while the other returns 0 (an int32). We have a complex type with a property ID. If this property is a nullable decimal, we receive the following error when enumerating the results of the sproc that returns an int32:

The 'ID' property on 'EntitryRequestReturn' could not be set to a 'Int32' value. You must set this property to a non-null value of type 'Decimal'.

Changing the type of the property to an int32 just moves the error to the other sproc, with the data types listed in the opposite order. Changing whether the types are nullable doesn't make any difference.

How can I get EF4 to convert an int column returned from a sproc into a decimal when constructing the complex type?