Dapper splitOn not working

c# dapper ms-access ms-access-2010

Question

I'm trying to run a MS Access query with Dapper. I keep receiving the following error message: When using the multi-mapping APIs ensure you set the splitOn param if you have keys other than Id

This is the code I'm using:

IEnumerable<BalanceHeader> balanceHeaders = 
    _connection.Query<BalanceHeader, Currency, BalanceHeader>(
        "GetFullBalanceHeaders", 
        (header, currency) => 
        {
            header.Currency = currency;
            return header;
        }, 
        splitOn: "IsoCode", 
        commandType: CommandType.StoredProcedure);

This is the SQL statement:

SELECT BalanceHeader.Reference
,  BalanceHeader.ReferenceCount
,  BalanceHeader.GroupName
,  Currency.IsoCode
,  Currency.ExchangeRate
FROM [Currency]
INNER JOIN BalanceHeader ON Currency.IsoCode = BalanceHeader.IsoCode;

The splitOn param has cleary been set so what else am I doing wrong? Or is this an issue with MS Access?

Accepted Answer

Updating the version of Dapper from 1.25 to 1.38 has fixed the issue!



Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why