I'm having a go with the razor functionality in service stack. I have a razor cshtml view working for one of my response DTO's.
I need to access some values from the request DTO in the razor view that have been filled in from some fields from the REST route, so i can construct a url to put into the response html page and also label some form labels.
Is there anyway of doing this? I don't want to duplicate the property from the request DTO into the response DTO just for this html view. Because i'm trying to emulate an existing REST service of another product, i do not want to emit extra data just for the html view.
eg
http://localhost/rest/{Name}/details/{Id}
eg
@inherits ViewPage<DetailsResponse>
@{
ViewBag.Title = "todo title";
Layout = "HtmlReport";
}
this needs to come from the request dto NOT @Model
<a href="/rest/@Model.Name">link to user</a>
<a href="/rest/@Model.Name/details/@Model.Id">link to user details</a>
ViewBag
, thePage
object, theSession
, etc. – McGarnagle