Question: I have a Cars Model in my rails app which has three columns Car\_id , car\_name and fuel\_type. So in my table the car\_name is coming many times.

I want to know how can I filter this Car table so that one car\_name appears only one time in the returned array?

I want the full filtered table to be returned not just the distinct car names.

Answer: 
This is what probably happens: You don't wait for `DownloadFile` to complete, the control returns to `Main`, you reach `Console.ReadKey`, you press on a key and the program ends before it had a chance to complete the download.

When you use `await Task.Factory.StartNew(() => Task.Delay(2000));` instead you're not really waiting the whole 2 seconds because `Task.Factory.StartNew` returns a `Task<Task>` so `Console.WriteLine` is reached immediately. You need to use `Task.Run` instead.

The problem is that you're not waiting for you operation to complete. Regularly you would do that with await, but that can't be used in `Main` so just in this case use `Task.Wait`:

```
static void Main()
{
    DownloadFile().Wait();
}

```
There's nothing wrong with `await` usage here. You should monitor the download progress of the file you're downloading. Add event handler for `DownloadProgressChanged`

```
 using (WebClient wc = new WebClient())
   {
     wc.DownloadProgressChanged += wc_DownloadProgressChanged;
     string address = "http://www.ayobamiadewole.com/Blog/Files/AOP.zip";
     await wc.DownloadFileTaskAsync(address, "f.zip");
   }

 static void wc_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
   { 
       Console.WriteLine("\r{0} % Completed.", e.ProgressPercentage);
   }

```