/// <summary>
        /// Returns the number of table rows per database table.
        /// </summary>
        public static async Task <List <TableRowCounts> > GetTableRowCountsAsync <T>(this DbContextBase <T> c) where T : DbContext
        {
            var rawSqlQuery = c.ExecuteQuery <TableRowCounts>(
                @"CREATE TABLE #counts
                    (
                        TableName varchar(255),
                        TableRowCount int
                    )

                    EXEC sp_MSForEachTable @command1='INSERT #counts (TableName, TableRowCount) SELECT ''?'', COUNT(*) FROM ?'
                    SELECT TableName, TableRowCount FROM #counts ORDER BY TableName, TableRowCount DESC
                    DROP TABLE #counts");

            var tableCountResults = await rawSqlQuery.ToListAsync();

            return(tableCountResults);
        }