Example #1
0
 public EntityAuditConnector(ConnectorClient connectorClient)
 {
     this.connectorClient = connectorClient;
 }
Example #2
0
 public EndPointConnector(ConnectorClient connectorClient)
 {
     this._connectorClient = connectorClient;
 }
Example #3
0
        public static IApiResponseContextDto <TResponse> Post <TRequestDto, TResponse>(ConnectorClient connectorClient,
                                                                                       TRequestDto dto, string url)
        {
            string jsonToSend = JsonConvert.SerializeObject(dto, Json.Serialization.Auto());

            var content  = new StringContent(jsonToSend, Encoding.UTF8, "application/json");
            var uri      = connectorClient.BaseUrl + url;
            var response = connectorClient.HttpClient.PostAsync(uri, content);

            response.Wait();

            var result = JsonConvert.DeserializeObject <ApiResponseContextDto <TResponse> >
                             (response.Result.Content.ReadAsStringAsync().Result, Json.Serialization.Auto());

            return(result);
        }