Skip to content

Instantly share code, notes, and snippets.

@mikebeaton
Created September 19, 2019 12:19
Show Gist options
  • Save mikebeaton/f49ffa5c4508af93f93f36599231d479 to your computer and use it in GitHub Desktop.
Save mikebeaton/f49ffa5c4508af93f93f36599231d479 to your computer and use it in GitHub Desktop.
var db = new MightyOrm(connectionString);
var now = DateTime.Now;
using (var multiple = db.ExecuteMultipleFromProcedure("PurchaseReport",
inParams: new { StartDate = now.AddMonths(6), EndDate = now })
{
multiple.NextResultSet();
foreach (var summary in multiple.CurrentResultSet.ResultsAs<PurchaseReportSummary>())
{
Console.WriteLine($"Total Sales for Report Period: ${summary.Total}");
}
multiple.NextResultSet();
foreach (var monthly in multiple.CurrentResultSet.ResultsAs<PurchaseReportMonthly>())
{
Console.WriteLine($"Total Sales for Month ${monthly.Month}: ${monthly.Total}");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment