Moq.Dapper icon indicating copy to clipboard operation
Moq.Dapper copied to clipboard

Can't query Tuples. Requires wrapping class type.

Open 80O opened this issue 3 years ago • 0 comments

Using connection.QueryAsync<(string, uint)>("SELECT name, id FROM users") will not yield any results when being mocked.

The only way to mock this is to wrap the tuple in a class eg:

class UserInfo
{
public string Name {get; set;}
public uint Id {get; set;}
}

`connection.QueryAsync<UserInfo>("SELECT name, id FROM users")`

Thought this library was not working or misconfigured at first before I tried this.

80O avatar Dec 19 '22 13:12 80O