예제 #1
0
        private async Task <IReflection> AddAsync(ReflectionDto dto)
        {
            string body = JsonConvert.SerializeObject(dto);

            Logging.Log().Debug($"Sending HTTP POST request to {this.reflectionUri} with body {body}");
            var content = new StringContent(body, Encoding.UTF8, "application/json");

            var response = await this.httpClient.PostAsync(this.reflectionUri, content);

            string responseString = await response.Content.ReadAsStringAsync();

            var responseDto = JsonConvert.DeserializeObject <ReflectionDto>(responseString);
            var model       = responseDto.ToReflection();

            return(model);
        }
예제 #2
0
        public IReflection Add(ReflectionDto dto)
        {
            var reflection = this.command.Add(dto);

            return(reflection);
        }
예제 #3
0
        public IReflection Add(ReflectionDto dto)
        {
            var model = this.AddAsync(dto).Result;

            return(model);
        }