public async Task <GetAccountResponse> GetAccountAsync(string condition, ColumnValue[] columnValues, Column[] columns, CancellationToken cancellationToken = default) { try { var request = new GetAccountRequest(_options.CustomerRelationshipManagementOperations.RequestSourceName, condition, columnValues, columns); var requestXml = request.BuildRequestDocument(); var responseXml = await _executor.ExecuteAsync(requestXml, cancellationToken); return(new GetAccountResponse(requestXml, responseXml)); } catch (OracleHospitalityClientException) { throw; } catch (Exception e) { throw new OracleHospitalityClientException($"{RequestCode.Kind.GetAccount} operation failed", e); } }
public void request_generation() { const string expected = @" <CRMMessage language=""en_US"" currency=""DKK""> <RequestSource name=""acme.com"" version=""1"" /> <RequestCode>GetAccount</RequestCode> <QueryCriteria conditions=""accountposref = ?""> <Condition name=""accountposref"" value=""123"" /> </QueryCriteria> <ResultSetDefinition> <Column>programid</Column> </ResultSetDefinition> </CRMMessage>"; var request = new GetAccountRequest( "acme.com", "accountposref = ?", new[] { new ColumnValue("accountposref", "123") }, new[] { new Column("programid") }); var requestXml = request.BuildRequestDocument(); Assert.Equal(XE.Parse(expected).ToString(), requestXml.ToString()); }