Created
January 30, 2015 15:19
-
-
Save KevM/470652ff29864adfe13e to your computer and use it in GitHub Desktop.
FubuMVC modify chain attribute example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [AttributeUsage(AttributeTargets.Method)] | |
| public class OutputXml : ModifyChainAttribute | |
| { | |
| public override void Alter(ActionCall call) | |
| { | |
| call.ParentChain().AlterConnegOutput(c => | |
| { | |
| c.ClearAll(); | |
| c.AddFormatter<XmlFormatter>(); | |
| }); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [OutputXml] | |
| public UploadResultModel post_file_upload(FileUploadPostRequest request) | |
| { | |
| // action goes here | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment