Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
DataMapper 3.0
-
None
Description
Paremeters should be typeof IDictionary<string, object>
Samples
=======
<!-- Nvelocity dynamic source -->
<select id="NVelocity.Simple" sqlSource="NVelocitySqlSource" resultMap="account-result" parameterClass="map">
select * from Accounts where Account_Id= $account.id
</select>
<select id="NVelocity.If" sqlSource="NVelocitySqlSource" resultClass="Account" remapResults="true" parameterClass="map">
SELECT
Account_ID as Id,
#if($account.FirstName == "Joe")
Account_FirstName as FirstName,
#elseif($account.LastName == "Dalton")
Account_LastName as LastName,
#end
Account_Email as EmailAddress
FROM
Accounts
where Account_Id= $account.id
</select>
Use as usual
IDictionary<string, object> parameters = new Dictionary<string, object>();
parameters.Add("account", paramAccount);
Account account = dataMapper.QueryForObject<Account>("NVelocity.Simple", parameters);