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

Task.AwaitResult may be removed and replaced with Task.Result #62

Closed
Konard opened this issue Apr 9, 2022 · 1 comment
Closed

Task.AwaitResult may be removed and replaced with Task.Result #62

Konard opened this issue Apr 9, 2022 · 1 comment

Comments

@Konard
Copy link
Member

Konard commented Apr 9, 2022

public static class TaskExtensions
{
/// <summary>
/// <para>Waits for completion of the asynchronous <see cref="Task{TReturn}"/> and returns its result.</para>
/// <para>Ожидает завершения асинхронной <see cref="Task{TReturn}"/> и возвращает её результат.</para>
/// </summary>
/// <typeparam name="TReturn"><para>The return value type.</para><para>Тип возвращаемого значения.</para></typeparam>
/// <param name="task"><para>The asynchronous <see cref="Task{TReturn}"/>.</para><para>Ассинхронная <see cref="Task{TReturn}"/>.</para></param>
/// <returns><para>The result of completed <see cref="Task{TReturn}"/>.</para><para>Результат завершённой <see cref="Task{TReturn}"/>.</para></returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static TReturn AwaitResult<TReturn>(this Task<TReturn> task) => task.GetAwaiter().GetResult();
}

@Konard
Copy link
Member Author

Konard commented Apr 9, 2022

This issue is duplicate of #61

@Konard Konard closed this as completed Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant