Пример #1
0
        public HtmlStringOutputPolicy()
        {
            Where.ResourceTypeIs <string>();
            Where.LastActionMatches(call => call.Method.Name.EndsWith("HTML", StringComparison.InvariantCultureIgnoreCase));

            Conneg.AddHtml();
        }
Пример #2
0
        public AjaxContinuationPolicy()
        {
            Where.ResourceTypeImplements <AjaxContinuation>();

            Conneg.AllowHttpFormPosts();
            Conneg.AcceptJson();

            Conneg.ClearAllWriters();
            Conneg.AddWriter(typeof(AjaxContinuationWriter <>));
        }
Пример #3
0
        public MyConnegPolicy()
        {
            // Apply some sort of matching
            // filter.
            Where.ChainMatches(chain => true);

            Conneg.AcceptJson();

            Conneg.AllowHttpFormPosts();

            Conneg.ApplyConneg();

            Conneg.AddHtml();

            Conneg.AddWriter(typeof(SpecialContentMediaWriter));

            Conneg.ClearAllWriters();

            Conneg.MakeAsymmetricJson();

            Conneg.MakeSymmetricJson();
        }
 public JsonMessageInputConvention()
 {
     Where.IsNotPartial();
     Where.ResourceTypeImplements <JsonMessage>().Or.InputTypeImplements <JsonMessage>();
     Conneg.MakeAsymmetricJson();
 }
 public CustomPolicy()
 {
     Conneg.AcceptJson();
 }
Пример #6
0
 public DictionaryOutputConvention()
 {
     Where.ResourceTypeImplements <IDictionary <string, object> >();
     Conneg.MakeAsymmetricJson();
 }
Пример #7
0
 public StringOutputPolicy()
 {
     Where.ResourceTypeIs <string>();
     Conneg.AddWriter <WriteString>();
 }
Пример #8
0
 public HtmlTagOutputPolicy()
 {
     Where.ResourceTypeImplements <HtmlTag>().Or.ResourceTypeImplements <HtmlDocument>();
     Conneg.AddHtml();
 }