Single database call pulling data from multiple tables in EF Core
<p>The following code currently opens a connection three times to my database, to pull out each object.</p>

<p>Is there a better way to craft the query so the database is only hit once and pulls back all the objects I'm looking for?</p>

<pre><code>var metadataResult = new MetadataViewModel
            {
                Milestones = goalsContext.Milestones.Select(m =&gt; new MilestoneViewModel
                {
                    Id = m.Id,
                    Name = m.Name,
                    Year = m.Year,
                    Date = m.Date
                }),
                Aggregates = goalsContext.Aggregates.Select(a =&gt; new AggregateViewModel
                {
                    Id = a.Id,
                    Name = a.Name
                }),
                Metrics = goalsContext.Metrics.Select(m =&gt; new MetricViewModel
                {
                    Id = m.Id,
                    Name = m.Name,
                    Description = m.Description
                })
            };
</code></pre>