1

I am getting an error on this function

private void Login_Click(object sender, RoutedEventArgs e)
{
    var auth0 = new Auth0Client("sample.auth0.com", "iRyFSIfQaeG4KXKd36D3CEPxkPyJ0Ekk");

    auth0.LoginAsync(new WindowWrapper(new WindowInteropHelper(this).Handle))
        .ContinueWith(
            t => { this.textBox1.Text = t.Result.Profile.ToString(); },
            TaskScheduler.FromCurrentSynchronizationContext());
}

Error Message:

Task does not contain a definition for result and no extension method accepting Result accepting first argument of type task could be found.

The Error is thrown on the line t.Result.Profile.ToString()

I am fairly new to Task Concept.Please help!

CodeDada
  • 425
  • 1
  • 11
  • 24
  • 1
    `Task` doesn't have a `Result` property. Only `Task` as one. It's like the difference between a `void` method and one that has a return type. Basically it means that `LoginAsync` is returning `Task` which is the asynchronous version of `void`. – juharr May 04 '16 at 18:16
  • Unless you work with an older .Net version use async / await for this. https://msdn.microsoft.com/en-us/library/hh191443.aspx – Peter Bons May 04 '16 at 18:29
  • 3
    I hope that is not your real token you are showing there... – monstertjie_za May 04 '16 at 18:33

0 Answers0