示例#1
0
        internal RestOptions()
        {
            EnumerableChunkedSupport = true;

            FaultDetail = FaultDetail.DetailedInDebugMode;

            JsonSettings = new JsonFormatterSettings();
            XmlSettings = new XmlFormatterSettings();
            ODataSettings = new ODataSettings();

            BeginRequestAction = context => { };
            EndRequestAction = context => { };
            ExceptionAction = (context, Exception) => { };
        }
示例#2
0
        /// <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;
        }