I use NPoco and I would like to have a query return two results - not a single object with two properties, but just two sums of some table. I was hoping to retrieve this as a tuple, but NPoco fails on that.
I tried this:
Tuple<decimal, int> res = db.Single<Tuple<decimal, int>>(
"select sum(alpha), sum(beta) from gamma");
but this gave me this error:
Exception: Cannot create POCO 'System.Tuple'2[[decimal...][int...]] It may have no parameterless constructor or be an interface or abstract class without a Mapper factory.
Is there a way to retrieve more than one value without needing to create a class for the return object?
Ok, same problem here, and I countered it. Npoco has problems with Tuples.
Turn that :
Into that :