public ContactsRepository()
 {
     object server;
     object database;
     object user;
     object password;
     var connectionString = new CouchDBConnectionString(System.Configuration.ConfigurationManager.ConnectionStrings["Contacts"].ConnectionString);
     connectionString.TryGetValue(CouchDBConnectionString.Server, out server);
     connectionString.TryGetValue(CouchDBConnectionString.Database, out database);
     connectionString.TryGetValue(CouchDBConnectionString.Username, out user);
     connectionString.TryGetValue(CouchDBConnectionString.Password, out password);
     SharpCouch.DB db = new SharpCouch.DB(server.ToString(), user.ToString(), password.ToString());
     contacts = Contacts.Connect(db, database.ToString());
 }
Exemplo n.º 2
0
        public ContactsRepository()
        {
            object server;
            object database;
            object user;
            object password;
            var    connectionString = new CouchDBConnectionString(System.Configuration.ConfigurationManager.ConnectionStrings["Contacts"].ConnectionString);

            connectionString.TryGetValue(CouchDBConnectionString.Server, out server);
            connectionString.TryGetValue(CouchDBConnectionString.Database, out database);
            connectionString.TryGetValue(CouchDBConnectionString.Username, out user);
            connectionString.TryGetValue(CouchDBConnectionString.Password, out password);
            SharpCouch.DB db = new SharpCouch.DB(server.ToString(), user.ToString(), password.ToString());
            contacts = Contacts.Connect(db, database.ToString());
        }