internal RestOptions() { EnumerableChunkedSupport = true; FaultDetail = FaultDetail.DetailedInDebugMode; JsonSettings = new JsonFormatterSettings(); XmlSettings = new XmlFormatterSettings(); ODataSettings = new ODataSettings(); BeginRequestAction = context => { }; EndRequestAction = context => { }; ExceptionAction = (context, Exception) => { }; }
/// <summary> /// Sets custom JSON formatter and result settings. /// </summary> /// <param name="builder">The JSON formatter settings builder.</param> /// <returns>The configuration options object.</returns> public RestOptions WithJsonFormatterSettings(Action<JsonFormatterSettings> builder) { if (builder == null) { throw new ArgumentNullException("builder"); } var settings = new JsonFormatterSettings(); builder(settings); JsonSettings = settings; return this; }