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

Html.DisplayFor use null conditional operator ?. #56062

Closed
EvgenyPrikhodko opened this issue Sep 1, 2021 · 2 comments
Closed

Html.DisplayFor use null conditional operator ?. #56062

EvgenyPrikhodko opened this issue Sep 1, 2021 · 2 comments
Labels
Area-Compilers Feature Request Resolution-By Design The behavior reported in the issue matches the current design

Comments

@EvgenyPrikhodko
Copy link

EvgenyPrikhodko commented Sep 1, 2021

Hello everyone.
Please register your wish.

dotnet/aspnetcore#35991


@foreach (var item in Model)
{
<td>
@Html.DisplayFor(modelItem => item.Employee?.Name) <-- is Null 
</td>

image

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Sep 1, 2021
@EvgenyPrikhodko EvgenyPrikhodko changed the title How to use Html.DisplayFor correctly ? Html.DisplayFor use null conditional operator ?. Sep 1, 2021
@jinujoseph jinujoseph removed the untriaged Issues and PRs which have not yet been triaged by a lead label Sep 7, 2021
@jinujoseph jinujoseph added this to the Backlog milestone Sep 7, 2021
@jinujoseph jinujoseph added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead and removed Area-IDE labels Sep 7, 2021
@jinujoseph jinujoseph removed this from the Backlog milestone Sep 7, 2021
@jinujoseph
Copy link
Contributor

ref dotnet/csharplang#2545

@jaredpar
Copy link
Member

jaredpar commented Sep 9, 2021

Closing as this behavior is "by design" in the compiler today. The language does not support ?. inside of an expression tree. The referenced csharplang issue tracks the language supporting that feature.

@jaredpar jaredpar closed this as completed Sep 9, 2021
@jaredpar jaredpar added Resolution-By Design The behavior reported in the issue matches the current design and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Feature Request Resolution-By Design The behavior reported in the issue matches the current design
Projects
None yet
Development

No branches or pull requests

3 participants