Esempio n. 1
0
        public RestClientBuilder WithDefaultRequestSegment <T>(string name, T value)
        {
            name.AssertNotNullOrEmpty(nameof(name));

            var segment = new RequestRouteSegment(name, RestValue.Create(value));

            _container.Register(new RequestEnricher(x => x.AddRouteSegment(segment)));

            return(this);
        }
Esempio n. 2
0
        public void AddRouteSegment(RequestRouteSegment segment)
        {
            segment.AssertNotNull(nameof(segment));

            if (_routeSegments == null)
            {
                _routeSegments = new List <RequestRouteSegment>();
            }

            _routeSegments.Add(segment);
        }