Conversation
* Add support for multiple view engines * Make the view locations configurable
| public static class ResponseExtensions | ||
| { | ||
| public static async Task AsHtml(this HttpResponse response, string view, object obj, CancellationToken cancellationToken = default) | ||
| { |
There was a problem hiding this comment.
Instead of passing the view name explicitly, it would be good to have some sensible defaults based on the route structure (somehow). As it stands, content negotiation is essentially impossible
There was a problem hiding this comment.
Yeah, I'm open to ideas here. At the moment I am using the ViewModel name if no view name has been passed in.
There was a problem hiding this comment.
I've been wondering if named routes are a way to go or not, can't make my mind up and it's 11:05pm.
If we did add named routes in some fashion, it would help close off CarterCommunity/Carter#79 as well
There was a problem hiding this comment.
I also wonder if we should have the ability to have a layout, and then render views inside the parent layout. 🤔
I know I'm essentially describing Razor in parts here
Added in negotiate overload
|
superseded by #3 |
A work in progress, hacked some code together over the weekend to get carter returning html.
Update
Added support for multiple view engines by creating interfaces.
Made the view locations configurable.
Relies on CarterCommunity/Carter#127 to resolve the module name.