public HtmlStringOutputPolicy() { Where.ResourceTypeIs <string>(); Where.LastActionMatches(call => call.Method.Name.EndsWith("HTML", StringComparison.InvariantCultureIgnoreCase)); Conneg.AddHtml(); }
public AjaxContinuationPolicy() { Where.ResourceTypeImplements <AjaxContinuation>(); Conneg.AllowHttpFormPosts(); Conneg.AcceptJson(); Conneg.ClearAllWriters(); Conneg.AddWriter(typeof(AjaxContinuationWriter <>)); }
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(); }
public DictionaryOutputConvention() { Where.ResourceTypeImplements <IDictionary <string, object> >(); Conneg.MakeAsymmetricJson(); }
public StringOutputPolicy() { Where.ResourceTypeIs <string>(); Conneg.AddWriter <WriteString>(); }
public HtmlTagOutputPolicy() { Where.ResourceTypeImplements <HtmlTag>().Or.ResourceTypeImplements <HtmlDocument>(); Conneg.AddHtml(); }