Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

板书错误 #44446

Open
baby0112u opened this issue Jan 20, 2025 · 1 comment
Open

板书错误 #44446

baby0112u opened this issue Jan 20, 2025 · 1 comment

Comments

@baby0112u
Copy link

baby0112u commented Jan 20, 2025

Type of issue

Other (describe below)

Description

“ 在下面的示例中,Result 属性是 C# 中的 Task<Task> 或 Visual Basic 中的 Task(Of Task(Of String))。”
对应的代码是:
// Note the type of t and t2.
Task<Task> t = Task.Factory.StartNew(() => DoWorkAsync());
Task<Task> t2 = DoWorkAsync().ContinueWith((s) => DoMoreWorkAsync());

// Outputs: System.Threading.Tasks.Task`1[System.String]
Console.WriteLine(t.Result);

Result 属性应该是是 C# 中的 Task

Page URL

https://learn.microsoft.com/zh-cn/dotnet/standard/parallel-programming/how-to-unwrap-a-nested-task

Content source URL

https://github.com/dotnet/docs/blob/main/docs/standard/parallel-programming/how-to-unwrap-a-nested-task.md

Document Version Independent Id

2d7cf09a-afc5-3149-a472-cfd3acf3c697

Article author

@IEvangelist

Metadata

  • ID: 8cdd82b8-fed5-2954-f1fd-f6039d802346
  • Service: dotnet-fundamentals

Related Issues

@baby0112u
Copy link
Author

// Note the type of t and t2.
Task<Task> t = Task.Factory.StartNew(() => DoWorkAsync());
Task<Task> t2 = DoWorkAsync().ContinueWith((s) => DoMoreWorkAsync());

// Outputs: System.Threading.Tasks.Task`1[System.String]
Console.WriteLine(t.Result);

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant