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

Razor templates in @functions block #11410

Closed
oliversturm opened this issue Mar 14, 2019 · 1 comment
Closed

Razor templates in @functions block #11410

oliversturm opened this issue Mar 14, 2019 · 1 comment
Labels
Blazor Source - Docs.ms Docs Customer feedback via GitHub Issue
Milestone

Comments

@oliversturm
Copy link

As described, I can create Razor templates like this:

@{
  RenderFragment foo = @<p>this is text</p>;
  RenderFragment<string> titleFragment = (title) => @<h4>@title</h4>;
}

However this syntax doesn't seem to be supported at all in an @functions block -- both of the above assignments render a series of compiler errors.

I expected to be able to do this:

  [Parameter]
  RenderFragment<string> TitleTemplate { get; set; } =
    (title) => @<h4 class="card-title">@title</h4>;

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@dotnet-bot dotnet-bot added the Source - Docs.ms Docs Customer feedback via GitHub Issue label Mar 14, 2019
@guardrex guardrex added this to the Backlog milestone Mar 14, 2019
@danroth27
Copy link
Member

Thank you for this feedback! We are planning on support a variant of Razor templates in functions blocks in the next preview update to .NET Core 3.0. You can see details about it here: dotnet/aspnetcore#5577

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blazor Source - Docs.ms Docs Customer feedback via GitHub Issue
Projects
Archived in project
Development

No branches or pull requests

4 participants