Skip to content

Control flow directives (@if, @foreach) allowed inside @code block #13112

Description

@emschnee

Razor currently allows Razor control flow directives like @if and @foreach inside the @code block of a component.

Image

This behaviour should probably be either be disallowed, or produce a dianostic warning/error because it blurs the distinction between Razor syntax and C#.

Metadata

Metadata

Assignees

No one assigned

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions