title: How do you convert numeric types in the mapping from a stored procedure to a complex type in Entity Framework 4?
body: <p>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:</p>
  
  <pre><code>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'.
  </code></pre>
  
  <p>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.</p>
  
  <p>How can I get EF4 to convert an int column returned from a sproc into a decimal when constructing the complex type?</p>