UnoSD / Moq.Dapper

Moq extensions for Dapper methods.
GNU General Public License v2.0
173 stars 78 forks source link

QueryAsync with multiple types does not work #68

Open ricochetbrown opened 3 years ago

ricochetbrown commented 3 years ago

`var results = await connection.QueryAsync( "[dbo].[GetSomething]", types: new[] { typeof(Something), typeof(ASubThing), typeof(AnotherSubThing) }, map: objects => { var result = objects[0] as Something?? new Something();

                result.FirstSubThing= objects[1] as ASubThing?? new ASubThing();
                result.SecondSubThing= objects[2] as AnotherSubThing?? new AnotherSubThing();

                return result;
            },
            dbArgs,
            commandType: CommandType.StoredProcedure);`

moq.dapper continues to give an error saying that (When using the multi-mapping APIs ensure you set the splitOn param if you have keys other than Id (Parameter 'splitOn') even though the code works fine when the api is running.