Open A9G-Data-Droid opened 7 months ago
Thanks for pointing out, this is very interesting! BlazorEngineCore 😄
This feature can be used to test the following Razor statements to see if they work correctly. Currently, RazorEngineCore does not support this C# 9 syntax
@{
var ss = new { Qt="test"};
string result = "";
switch (ss)
{
case {Qt:"test"}:
result = "show some text";
break;
}
@:@result
}
After looking deeper, I'm early. They are still arguing about the namespace and firming the architecture. I wouldn't experiment with this until they are done with things like this: https://github.com/dotnet/razor/issues/8400
They are moving the namespace used by this library. After the move to a final location, we can see how the new API fits into the CreateAndCompileToStream
workflow.
https://andrewlock.net/exploring-the-dotnet-8-preview-rendering-blazor-components-to-a-string/ I tested it according to the methods introduced in the article, and it worked well.
More about:
It looks like NET8 brings us a new and improved way to render razor with their
HtmlRenderer
!This could be a good opportunity to release a new major version of the RazorEngineCore with breaking changes and the new renderer. This would allow us to close any issues that are blocked due to breaking changes. Leave this version as it for legacy and make a new NET8 version!
https://andrewlock.net/exploring-the-dotnet-8-preview-rendering-blazor-components-to-a-string/