예제 #1
0
        /// <summary>
        /// Deep copy of this object
        /// </summary>
        /// <returns></returns>
        public SetupContext Clone()
        {
            var setupContext = new SetupContext()
                               .Name(_name)
                               .Host(_host)
                               .Uri(_uri)
                               .Body(_body)
                               .HttpClient(_httpClient);

            foreach (var header in _headers)
            {
                setupContext.Header(header.Key, header.Value);
            }

            foreach (var query in _queryStrings)
            {
                setupContext.Query(query.Key, query.Value);
            }

            foreach (var parameter in _parameters)
            {
                setupContext.Param(parameter.Key, parameter.Value);
            }

            foreach (var file in _files)
            {
                setupContext.File(file.FileName, file.ContentDispositionName, file.ContentType, file.Content);
            }

            return(setupContext);
        }