protected override DoNext applyOutputs(IOutputNode node, BehaviorChain chain, ConnegSettings settings) { node.Add(settings.FormatterFor(MimeType.Json)); node.Add(settings.FormatterFor(MimeType.Xml)); return(DoNext.Continue); }
protected override DoNext applyInputs(IInputNode node, BehaviorChain chain, ConnegSettings settings) { node.Add(typeof(ModelBindingReader <>)); node.Add(settings.FormatterFor(MimeType.Json)); node.Add(settings.FormatterFor(MimeType.Xml)); return(DoNext.Continue); }
public void add_formatter_places_it_first() { var settings = new ConnegSettings(); settings.AddFormatter(new AjaxAwareJsonSerializer()); settings.FormatterFor(MimeType.Json) .ShouldBeOfType <AjaxAwareJsonSerializer>(); }
protected override DoNext applyOutputs(IOutputNode node, BehaviorChain chain, ConnegSettings settings) { if (chain.AnyActionHasAttribute <AsymmetricJsonAttribute>() || chain.ResourceType().CanBeCastTo <IDictionary <string, object> >()) { node.Add(settings.FormatterFor(MimeType.Json)); return(DoNext.Stop); } return(DoNext.Continue); }
protected override DoNext applyInputs(IInputNode node, BehaviorChain chain, ConnegSettings settings) { if (chain.AnyActionHasAttribute <SymmetricJsonAttribute>()) { node.Add(settings.FormatterFor(MimeType.Json)); return(DoNext.Stop); } return(DoNext.Continue); }
protected override DoNext applyInputs(IInputNode node, BehaviorChain chain, ConnegSettings settings) { if (!chain.ResourceType().CanBeCastTo <AjaxContinuation>()) { return(DoNext.Continue); } node.Add(typeof(ModelBindingReader <>)); node.Add(settings.FormatterFor(MimeType.Json)); return(DoNext.Stop); }