Are Dapper-dot-Net "Query" and "QueryMultiple" equal in performance and behavior when returning a single result set?

We recently built a mapping class called TableMapperT, which encapsulates our multipap Dapper function. We build it separately from our "command" object called TableCommand, which contains sql text information, etc. However, to use it, we must use the "QueryMultiple", which is also necessary to return a single result and then display it.

We performed basic performance indicators, and the performance seems to be equal to the usual Query api (looping through the same query with the same multimap, but with QueryMultiple using "Read ()".

So the question is, is there a fundamental flaw in performance or behavior when using QueryMultiple for a single record set? It seems not, but I thought that the community as a whole could have a deeper understanding.

Sam Shaffron points out that the results are not buffered in this message ( Dapper.NET and are stored in proc with multiple result sets ), but this was the original, and the source code looks like this: "buffered" is now true (public IEnumerable Read (bool buffered = true )

Using (below) is very clean and allows us to argue about connecting and error handling in one place, which is our method of expanding queries on a database object.

var command = new TableCommand(<SQL>,<Parameters>,<Timeout>);
var mapper = new TableMapper<OrderLineItem>();  //return type here
mapper.SetMap<OrderLineItem,Product>((oli,p)=>{oli.Product = p;return oli}); //input types here

return this.Database.Query(command,mapper);//returns IEnumerable<OrderLineItem>
+4
source share
1 answer

, . , IMO, . , , , .

:

  • Read<T>/Query<T> ,
  • : API - , API .
+3

All Articles