Skip to content

Blazor EditorRequired attribute incorrectly reports RZ2012 warning when @bind-MyVariable= is used instead of MyVariable= syntax. #7395

@vsfeedback

Description

@vsfeedback

This issue has been moved from a ticket on Developer Community.


[severity:It bothers me. A fix would be nice]
In a blazor component, I want to require that a string parameter be provided, but I also want to bind to it like this:

[EditorRequired]
[Parameter]
public string GLCode { get; set; } = null!;

[Parameter]
public EventCallback GLCodeChanged { get; set; }

When I use that component, and I provide the value with a @bind-GLCode="@parentGLCode", I get an incorrect RZ2012 warning that GLCode may not have been provided.

<GLCodePickerTwoColumnComponent
@bind-GLCode="@localDistribution.GLAccount">

Warning (active) RZ2012 Component 'GLCodePickerTwoColumnComponent' expects a value for the parameter 'GLCode', but a value may not have been provided.


Original Comments

Feedback Bot on 12/8/2021, 07:18 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.


Original Solutions

(no solutions)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-compilerUmbrella for all compiler issuesauthor: migration bot 🤖The issue was created by a issue mover bot. The author may not be the actual authorbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions