I am trying to develop a simple CMS using Blazor Server App (or Blazor Web App). I want users to define their own web pages' layout/template and contents online (in admin section). And, they will be stored in DB as string. Then, by calling user-defined routes, the content is fetched from DB and should be rendered runtime.
The output should be the same as if the user create Razor component and build the project (the template may have @code {}
section).
I know that I can use RenderFragment
, but it does not compile the code inside the markup.
For .cshtml
files, it is possible implementing and registering custom Virtual FileProvider
. But, it does not work for .razor
files.
I am trying with Blazor Server App (or Blazor Web App in .NET 8).
Is it possible to build a Razor component runtime from a string variable?