Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QueryAsync with multiple types does not work #68

Open
ricochetbrown opened this issue Apr 14, 2021 · 0 comments
Open

QueryAsync with multiple types does not work #68

ricochetbrown opened this issue Apr 14, 2021 · 0 comments

Comments

@ricochetbrown
Copy link
Contributor

`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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant