The await operator can only be used in a method or lambda marked with the 'async' modifier
<p>I'm getting this error (in Title), here's my code </p>

<pre><code>public async Task&lt;int&gt; ReadTextFile()
    {
        //
        // Read in a file line-by-line, and store it all in a List.
        //
        var watch = Stopwatch.StartNew();
        using (StreamReader reader = new StreamReader("Users.txt"))
        {
            String line;
            while ((line = await reader.ReadLineAsync()) != null)
            {
                String[] splitLines = line.Split(' ');
                User user;
                if (splitLines.Length == 3)
                {
                    user = new User
                        {
                            FirstName = splitLines[0],
                            MiddleName = splitLines[1],
                            LastName = splitLines[2]
                        };
                }

                else if (splitLines.Length == 2)
                {
                    user = new User
                    {
                        FirstName = splitLines[0],
                        LastName = splitLines[1]
                    };
                }

                else
                {
                    user = new User
                    {
                        FirstName = splitLines[0]
                    };
                }

                users.Add(user);
            }
        }
        int number = 0;
        for (int i = 0; i &lt; 6000; i++)
        {
            for (int j = 0; j &lt; 1000; j++)
            {
                for (int k = 0; k &lt; 1000; k++)
                {
                    number += 1;
                } 
            }
        }
            watch.Stop();
        var elapsedMs = watch.ElapsedMilliseconds;
        return number;
    }


public async Task&lt;List&lt;User&gt;&gt; GetUsers()
    {
        await this.ReadTextFile();
        return this.users;
    }


 public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
    }

    private void Button_Click(object sender, RoutedEventArgs e)
    {
        MainWindowViewModel viewModel = new MainWindowViewModel();
        var x = await viewModel.GetUsers();//ERROR IS ON THIS LINE
        //dataGrid.ItemsSource = await viewModel.GetUsers();


    }
}
</code></pre>

<p>Going by the example here <a href="https://msdn.microsoft.com/en-us/library/hh524395.aspx" rel="nofollow">https://msdn.microsoft.com/en-us/library/hh524395.aspx</a>
My code should work, so I'm not sure what's happening, can someone please help?</p>