Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Non-null parameters for Blazor components #64810

@vsfeedback

Description

@vsfeedback

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


If I declare a blazor/razor component to expect a non-null parameter value, like this:

[Parameter, EditorRequired]
public Season season { get; set; }

then I would expect there to be at least a warning if I were to pass it a possibly null-valued nullable variable like this:

Season? nullableSeason;
<Component season="nullableSeason" />

But there is no such warning in the current version of Visual Studio (Version: 18.0.0 Insiders [11109.219]), leaving a pretty big hole in nullability safety checking.

Can this be improved?


Original Comments

Feedback Bot on 10/14/2025, 01:27 AM:

Thank you for taking the time to provide your suggestion. We will do some preliminary checks to make sure we can proceed further. You will hear from us in about a week on our next steps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Author: Migration Bot 🤖The issue was created by a issue mover bot. The author may not be the actual author.Status: Resolvedarea-blazorIncludes: Blazor, Razor Componentsquestion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions