aspnetcore/test/Microsoft.AspNetCore.Blazor...
Ryan Nowak c97cb8c18b Add support for Razor templates
Adds support for Razor templates and RenderFragment<T>.

Razor templates are a little-known Razor feature that looks like:
```
@<tag>....<tag>
```

It's so little known that it's not even covered in our docs, but it's
been around for many many years. This features hasn't been implemented
until now for Blazor, and this feature brings it back as a build
building block for templated components (more to come).

In Blazor land a template like:
```
@{ RenderFragment<Person> template = @<div>@item.Name</div>; }
```

complies to code like:
```
RenderFragment<Person> template = (__builder, item) =>
{
    __builder.OpenElement(...);
    ...
    __builder.CloseElement(...);
}
```

Since the declaration always has a generic type parameter inside, it
needs to be in a context where the type is known.. ie: not with `var`.

See tests for ways to consume templates.

NOTE: There are the following caveats for templates
- Templates require a single root element.
- Templates don't work in the `@functions { }` block

These limitations are baked into the core of Razor and will take a while
for us to address (v3.0).
2018-08-31 19:10:42 -07:00
..
Razor
TestFiles Add support for Razor templates 2018-08-31 19:10:42 -07:00
BindRazorIntegrationTest.cs
BootJsonWriterTest.cs
ComponentDiscoveryRazorIntegrationTest.cs
ComponentRenderingRazorIntegrationTest.cs Add support for Razor templates 2018-08-31 19:10:42 -07:00
DeclarationRazorIntegrationTest.cs
DesignTimeCodeGenerationTest.cs Add support for Razor templates 2018-08-31 19:10:42 -07:00
DiagnosticRazorIntegrationTest.cs
DirectiveRazorIntegrationTest.cs
FilePathRazorIntegrationTest.cs
Microsoft.AspNetCore.Blazor.Build.Test.csproj
RazorBaselineIntegrationTestBase.cs
RazorIntegrationTestBase.cs
RenderingRazorIntegrationTest.cs Add support for Razor templates 2018-08-31 19:10:42 -07:00
RuntimeCodeGenerationTest.cs Add support for Razor templates 2018-08-31 19:10:42 -07:00
RuntimeDependenciesResolverTest.cs
TemplateRazorIntegrationTest.cs Add support for Razor templates 2018-08-31 19:10:42 -07:00
TypingTest.cs
WorkingDirectoryRazorIntegrationTest.cs