fubumvc

Thunderdome MVC- Why one-model-in in MVC?

删除回忆录丶 提交于 2019-12-23 08:53:22
问题 When Jeremy & Chad posted about their FubuMvc project, one of the differentiators they mentioned was their "Thunderdome Principal": The “Thunderdome Principle” – All Controller methods take in one ViewModel object (or zero objects in some cases) and return a single ViewModel object (one object enters, one object leaves). The Controller classes will NEVER be directly exposed to anything related to HttpContext. Nothing makes me cry like seeing people trying to write tests that mock or stub that

How to create nested <ul> <li> tags with HtmlTags (FubuMVC)

試著忘記壹切 提交于 2019-12-08 19:52:34
I have no previous experience with FubuMVC HtmlTags library, and I simply got stuck when trying to accomplish a simple nested structure like this: <ul> <li>text</li> <li>text <ul> <li>subtext</li> <li>subtext</li> </ul> </li> <li>text</li> </ul> Here's how I have it when building the string: public static HtmlString ChildNodesRecursive(DocumentNode documentNode) { var tag=""; if (documentNode.Children.Count > 0) { tag = "<ul>"; foreach (var c in documentNode.Children) { tag += "<li>" + c.Name; tag += ChildNodesRecursive(c); tag += "</li>"; } tag += "</ul>"; } return new HtmlString(tag); }

How to create nested <ul> <li> tags with HtmlTags (FubuMVC)

折月煮酒 提交于 2019-12-08 08:28:14
问题 I have no previous experience with FubuMVC HtmlTags library, and I simply got stuck when trying to accomplish a simple nested structure like this: <ul> <li>text</li> <li>text <ul> <li>subtext</li> <li>subtext</li> </ul> </li> <li>text</li> </ul> Here's how I have it when building the string: public static HtmlString ChildNodesRecursive(DocumentNode documentNode) { var tag=""; if (documentNode.Children.Count > 0) { tag = "<ul>"; foreach (var c in documentNode.Children) { tag += "<li>" + c.Name

How do you create a FubuMVC behavior that copies site configuration values to an output model?

删除回忆录丶 提交于 2019-12-08 04:24:20
问题 I'm trying to figure out to create a behavior that will copy a boolean site configuration value to an output model. This way I don't have to copy the bool in each action who's view requires it, but can simply add the behavior to the controller actions that need this value. In some of the older versions of FubuMVC, I believe behaviors could modify the output model after it's left the controller. But I'm not sure how to do this in the more recent versions of FubuMVC (or I've forgotten). Can