Пример #1
0
        /// <summary>
        /// 设置要提交的数据(以异步方式)
        /// </summary>
        /// <param name="data"></param>
        /// <param name="format"></param>
        public async Task SetRequestDataAsync(object data, SerializeFormat format)
        {
            if (data == null)
            {
                return;
            }

            _beforeArgs.Data   = data;
            _beforeArgs.Format = format;

            RequestWriter writer = new RequestWriter(Request);
            await writer.WriteAsync(data, format);
        }
Пример #2
0
        /// <summary>
        /// 设置要提交的数据
        /// </summary>
        /// <param name="data"></param>
        /// <param name="format"></param>
        public void SetRequestData(object data, SerializeFormat format)
        {
            if (data == null)
            {
                return;
            }

            _beforeArgs.Data   = data;
            _beforeArgs.Format = format;

            RequestWriter writer = new RequestWriter(Request);

            writer.Write(data, format);
        }