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. :-)
コード例 #1
0
ファイル: CouchDbCommand.cs プロジェクト: ifandelse/CouchRS
 // 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;
 }
コード例 #2
0
ファイル: CouchDbCommand.cs プロジェクト: ifandelse/CouchRS
 protected CouchDbCommand(IDbCommand command)
     : this(((CouchDbCommand)command).Connection, new WebClient(), null, new CouchQueryParameterVisitor(), new JsonResponseVisitor())
 {
     _visitor = new CouchCommandVisitor();
 }
コード例 #3
0
ファイル: CouchDbCommand.cs プロジェクト: ifandelse/CouchRS
 public CouchDbCommand(CouchDbConnection connection) 
     : this(connection, new WebClient(), null, new CouchQueryParameterVisitor(), new JsonResponseVisitor())
 {
     _visitor = new CouchCommandVisitor();
 }