We are working on an ASP.NET MVC 6 project, and you need to render Razor views different from the file system source (in particular, Azure Blob storage, but that doesn't matter). Previously (in MVC 5), you could create and register your own VirtualPathProvider, which can view content from DB or resource DLLs (for example).
It seems that the approach has been changed in MVC 6. Does anyone know where to look?
UPD: Here is an example of the code I'm looking for:
public IActionResult Index() { ViewBag.Test = "Hello world!!!"; string htmlContent = "<html><head><title>Test page</title><body>@ViewBag.Test</body></html>"; return GetViewFromString(htmlContent); }
The question arises: how to implement this GetViewFromString function?
source share