コード例 #1
0
ファイル: RestOptions.cs プロジェクト: dstarosta/GitProjects
        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
ファイル: RestOptions.cs プロジェクト: dstarosta/GitProjects
        /// <summary>
        /// Sets custom XML formatter and result settings.
        /// </summary>
        /// <param name="builder">The XML formatter settings builder.</param>
        /// <returns>The configuration options object.</returns>
        public RestOptions WithXmlFormatterSettings(Action<XmlFormatterSettings> builder)
        {
            if (builder == null)
            {
                throw new ArgumentNullException("builder");
            }

            var settings = new XmlFormatterSettings();
            builder(settings);

            XmlSettings = settings;
            return this;
        }