Xamarin forms sqlite Async await not wait the process
<p>because it does not respect the await</p>

<pre><code>public async Task Save(Ticket header, TicketLines newLines)
{
                Debug.WriteLine("init save");
                await dbConnection.RunInTransactionAsync(new Action&lt;SQLite.Net.SQLiteConnection&gt;(tran =&gt;
                {
                    dbConnection.InsertAsync(header).ContinueWith((t) =&gt;
                    {
                        Debug.WriteLine("-&gt; New header ID: {0}", header.Id);                       
                        foreach (var item in newLines)
                        {
                            item.DocumentId = = header.Id;
                        }
                        dbConnection.InsertAllAsync(newLines);                     
                    });
                    //tran.Commit();                    
                }));
                Debug.WriteLine("End Save");

}
</code></pre>

<p>Order debug </p>

<ol>
<li>init save 

<ol start="2">
<li>End save  sds</li>
<li>->New header ID: 1</li>
</ol></li>
</ol>