Example #1
0
        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);
        }
Example #2
0
        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>();
        }
Example #4
0
        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);
        }
Example #5
0
        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);
        }
Example #6
0
        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);
        }