Multiple queries in async/await (Error: IEnumerable does not contain ToListAsync())
<p>I would like to share that I went through other similar posts but the suggested solutions din't work for me and that's why I am creating a separate thread.I am trying to join the two results using Asynchronous programming in Entity Framework.I have three methods as below:</p>

<p>The method <code>PreprocessAppointment()</code> waits on other two methods <code>GetApptTask()</code> and <code>GetZoneTask()</code> </p>

<pre><code>public async void PreprocessAppointment()
        {
            var task_1 = GetApptTask();
            var task_2 = GetZoneTask();
            await Task.WhenAll(task_1, task_2);
        }
</code></pre>

<p>The method <code>GetApptTask()</code> does not give any error.</p>

<pre><code>public async Task&lt;IEnumerable&lt;appointments&gt;&gt; GetApptTask(){

            var result = db.appointments.Where(d =&gt; d.appt_client_id == 15 &amp;&amp; d.customer_id == 68009);

            return await result.ToListAsync();


        }
</code></pre>

<p>The method <code>GetZoneTask()</code>gives the following error. <strong><code>IEnumerable &lt;zones&gt; does not contain definition for ToListAsync()</code>.</strong></p>

<pre><code>public async Task &lt;IEnumerable&lt;zones&gt;&gt; GetZoneTask()
        {
            var result = db.zones.Where(d =&gt; d.zone_client_id == "15").AsEnumerable().Distinct&lt;zones&gt;(new zones.Comparer());
            return await result.ToListAsync();
        }
</code></pre>

<p>I am unable to find out what might be causing this <strong>error</strong>.I am attaching the models structures as well for <code>appointments</code> and <code>zones</code> below. The only difference between the models apart from fields is the definition of <code>Comparer</code> class in <code>zones</code>.</p>

<p><strong>zones.cs</strong>   </p>

<pre><code>public class zones
    {
        [Column(Order=0),Key]
        [StringLength(50)]
        public string zone_client_id { get; set; }
        //public int zone_client_id { get; set; }

        [Column(Order = 1), Key]
        [StringLength(5)]
        public string zip { get; set; }


        [StringLength(50)]
        public string zone { get; set; }

        public class Comparer : IEqualityComparer&lt;zones&gt;
        {
            public bool Equals(zones x, zones y)
            {
                return x.zone_client_id == y.zone_client_id
                     &amp;&amp; x.zip == y.zip
                     &amp;&amp; x.zone == y.zone;
            }

            public int GetHashCode(zones obj)
            {
                return obj.zone_client_id.GetHashCode() ^
                      obj.zip.GetHashCode() ^
                      obj.zone.GetHashCode();   
            }
        }
    }
</code></pre>

<p><strong>appointments.cs</strong>    </p>

<pre><code> public  partial class appointments
    {

        public int appt_client_id { get; set; }

        public int customer_id { get; set; }

        [Key]
        public int appt_id { get; set; }

        public DateTime appt_date_time { get; set; }

        [StringLength(200)]
        public string recording_uri { get; set; }

        public DateTime time_stamp { get; set; }

        [Required]
        [StringLength(20)]
        public string appt_status { get; set; }

        [Required]
        [StringLength(5)]
        public string appt_type { get; set; }
}
</code></pre>