dotnet / dotnet/aspnetcore

Reconsider EditorForAsync/DisplayForAsync

Open
#61,438 0 comments 1 reaction 0 assignees View on GitHub
area-mvc
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

Originally reported as #38043, which was ultimately closed saying the work would take place as part of #3956. #3956 was just closed in favor of investing work in Blazore instead.

I believe the original request #38043 is still valid and worthy of attention:

HtmlHelper.EditorFor and HtmlHelper.DisplayFor do not have async counterparts and, as a result, awaiting in a Template has been known to cause deadlocks. See related, closed issue https://github.com/dotnet/aspnetcore/issues/4880. https://github.com/dotnet/aspnetcore/issues/7083 relates to Html.Partial.

It's concerning that this feature of Razor engine is quietly prone to deadlocks, particularly with no warning that I've seen in documentation. I wish these APIs would be reconsidered for a major .NET release.

If these APIs are not introduced, guidance and documentation as to the recommended way to get EditorFor functionality without using EditorFor would be greatly appreciated.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.