Traverses the ParseTree produced when the text command is parsed as CouchQuery syntax, and builds up the request(s) that will be issued to the CouchDB server. Notice the similar approach to the JsonVisitor class - that's because Alex is a genius and Jim likes to copy him. :-)
Beispiel #1
0
 // 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;
 }
Beispiel #2
0
 protected CouchDbCommand(IDbCommand command)
     : this(((CouchDbCommand)command).Connection, new WebClient(), null, new CouchQueryParameterVisitor(), new JsonResponseVisitor())
 {
     _visitor = new CouchCommandVisitor();
 }
Beispiel #3
0
 public CouchDbCommand(CouchDbConnection connection) 
     : this(connection, new WebClient(), null, new CouchQueryParameterVisitor(), new JsonResponseVisitor())
 {
     _visitor = new CouchCommandVisitor();
 }