Skip to content

ViewComponentTagHelper: Allow optional parameters #5011

@pawchen

Description

@pawchen

Say we have a ViewComponent class

class MyViewComponent
{
    IViewComponentResult Invoke( bool showSomething = false ) { ... }
}

It would be great to just only write <vc:my /> in Razor if one don't want to show that something. Currently you have to write <vc:my show-something="false" />.

Metadata

Metadata

Assignees

Labels

DoneThis issue has been fixedaffected-mediumThis issue impacts approximately half of our customersarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesenhancementThis issue represents an ask for new feature or an enhancement to an existing onefeature-mvc-razor-viewsFeatures related to the Razor view engine for Razor pages and MVC viewsfeature-razor-pagesseverity-majorThis label is used by an internal tool

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions