I´m trying to use dapper with Oracle (ODP.NET) and I would like to use the \"QueryMultiple\" functionality.
Passing this string to the QueryMultiple method:
I suspect this is two or three separate things:
@
not :
(no idea if this depends on the RDBMS being used).If you look at the Dapper Google Code page the example given for QueryMultiple()
is:
var sql =
@"
select * from Customers where CustomerId = @id
select * from Orders where CustomerId = @id
select * from Returns where CustomerId = @id";
using (var multi = connection.QueryMultiple(sql, new {id=selectedId}))
{
var customer = multi.Read().Single();
var orders = multi.Read().ToList();
var returns = multi.Read().ToList();
...
}
Remove the semi-colon; add a new line and if you still have issues change the bind character.