public SwitchDatabase(CouchSession session, string database) { this.session = session; this.database = database; this.session.PushDatabase(); this.session.Use(database); }
public DesginDocuments(CouchSession session, string name) { this.session = session; this.Documents = session.Documents; this.name = name; this.basePath = "_design/" + name; }
public static void SetDesignDocumentsFromAssembly(CouchSession session, Assembly assembly, Dictionary <string, string> databaseOverrides = null) { databaseOverrides = databaseOverrides ?? new Dictionary <string, string>(); var designDocs = GetDesignDocuments(assembly); if (session.Db.Get() == null) { session.Db.Create(); } var defaultDb = session.DatabaseName; foreach (var databaseOverride in databaseOverrides) { using (session.Switch(databaseOverride.Value)) { if (session.Db.Get() == null) { session.Db.Create(); } } } foreach (var doc in designDocs) { using (session.Switch(databaseOverrides.ContainsKey(doc.Key) ? databaseOverrides[doc.Key] : defaultDb)) { session.Design(doc.Key).SetDocument(doc.Value); } } }
public Users(CouchSession session) { this.session = session; }
public BulkDocuments(CouchSession session) { this.session = session; }
public Changes(CouchSession session) { this.session = session; this.basePath = "_changes"; }
public Databases(CouchSession session) { this.session = session; }
public static void SetDesignDocumentsFromAssembly <T>(CouchSession session, Dictionary <string, string> databaseOverrides = null) { SetDesignDocumentsFromAssembly(session, typeof(T).Assembly, databaseOverrides); }