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); }
public IReflection Add(ReflectionDto dto) { var reflection = this.command.Add(dto); return(reflection); }
public IReflection Add(ReflectionDto dto) { var model = this.AddAsync(dto).Result; return(model); }