Servicestack ORMLite Query Multiple -


i wondering if ormlite had querymultiple solution dapper.

my use case in getting paged results.

return new {   posts = conn.select<post>(q => q.where(p => p.tag == "chris").limit(20, 10))   totalposts = conn.count<post>(q.where(p => p.tag == "chris")) }; 

i have few other cases i'm calculating other stats in addition main query, , i'm keen avoid multiple roundtrips.

(probably unrelated, i'm using postgresql)

you can this:

var boththings = db.exec(cmd => {      cmd.commandtext = @"         select * tablea         select * tableb";      var both = new bothaandb();      using (var reader = cmd.executereader())     {         both.a = reader.converttolist<a>();         reader.nextresult();         both.b = reader.converttolist<b>();     }      return both;  }); 

it might possible wrap in extension method, nothing clever coming mind.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -