So I am handling my own custom Route mapping (rather than allowing ServiceStack to automatically handle it), simply because all of my data is stored inside of a database, page content and all. I have a series of _Layout.cshtml files, and my Markdown is stored as a string.
So I suppose I am asking, what type of Service do I need to inherit (regular Service?) for my mapped Route, and what do I need to return to state "use Layout X and Markdown in string Y" ?
I have read through the examples on the ServiceStack Wiki and new example page, and was unable to find any samples for achieving this (everything seemed to be reading Markdown from a file, and Razor reading variables from a Database).
Please let me know if I am not clear in my question, and I will be happy to modify it accordingly.
--
EDIT
Some clarification:
Yes I got the regular Razor pages to load. Yes I got the regular Markdown from files to load.
I am simply now curious how to render Markdown into the Razor method "RenderBody()" which is in a string (from my database).
If you simply want to render a Markdown text as HTML (not Markdown Razor, ie no razor functionality!) you need to do these two steps:
Now you only have to add the rendered HTML to your Razor view at the appropriate place for example.
However, if your goal is to render a normal Markdown view (ie
.md
file in your ServiceStack project) in a Razor view, you need to follow this quote:Quoted from http://razor.servicestack.net.