I was just trying out Dapper for the very first time.
When I try to execute a query like the following, I encounter an ArgumentException "invalid type owner for DynamicMethod". Unlinke in this question, inserts work just fine when using Execute().
var parameters = new[] { new { accountName = name, accountPassword = password } };
var accounts = connection.Query<Account>(@"SELECT * FROM " + this.TableName + " WHERE name = @accountName AND password = @accountPassword", parameters);
I am building against .NET 4.5 on Win7.
Can anybody tell what I am doing wrong?
Your parameters should just be:
var parameters = new { accountName = name, accountPassword = password };
Not sure what you are trying to do with the new[] new
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With