Tag: fubumvc

FubuMVC using ModifyChainAttributes

January 30, 2015 Let's take a look at a handy way to quickly modify a FubuMVC behavior chain by simply placing an Attribute on the action method. This technique is handy when you have a one off change you need to make to a specific action and rolling your own site wide convention is too much. The Problem FubuMVC uses content negotiation to control how your output model is formatted. Great stuff when you are creating endpoints to be used as an API for your fancy JavaScript framework of choice. We ran into a problem on a specific API endpoint which supports file uploads where IE9 would barf on a JSON response after uploading a file. In this case the response was not being consumed by the client. No big deal let's force the output to be XML to ensure that IE9 is…

FubuMVC Wisdom: Bottles and StructureMap Registries

January 29, 2015 FubuMVC Bottles are pretty great. You can mix code, web endpoints and views in a "Bottle" assembly. Package them up as Nugets and you can re-use application functionality between your web applications just by adding a reference to a Bottle assembly. Auto Import Referenced Bottle Registries It is a really common pattern when you are using an IoC container like StructureMap in your Bottle that you want a registry imported when your bottle is loaded. Add the following code to the StructureMap Registry which you use when spinning up your FubuMVC application and your Bottle registries will be imported. More On Bottles If you Like Josh Arnold has a post or two about Bottles. Also Jeremy Miller did a nice presentation on Bottles at Monkey Square.