// this constructor overload was provided for better unit testing. The other constructor is called by the CouchConnetion object. public CouchDbCommand(CouchDbConnection connection, WebClient webClient, CouchCommandVisitor visitor, CouchQueryParameterVisitor parameterVisitor, JsonResponseVisitor jsonResponseVisitor) { Connection = connection; Parameters = new CouchDataParameterCollection(); _webClient = webClient; if(!String.IsNullOrEmpty(connection.UserName)) { _webClient.Credentials = new NetworkCredential(connection.UserName, connection.Password); } _visitor = visitor; _paramVisitor = parameterVisitor; _jsonResponseVisitor = jsonResponseVisitor; }
protected CouchDbCommand(IDbCommand command) : this(((CouchDbCommand)command).Connection, new WebClient(), null, new CouchQueryParameterVisitor(), new JsonResponseVisitor()) { _visitor = new CouchCommandVisitor(); }
public CouchDbCommand(CouchDbConnection connection) : this(connection, new WebClient(), null, new CouchQueryParameterVisitor(), new JsonResponseVisitor()) { _visitor = new CouchCommandVisitor(); }