internal static IMyCouchServerClient CreateServerClient() { var config = Environment; var uriBuilder = new MyCouchUriBuilder(config.ServerUrl); if (config.HasCredentials()) uriBuilder.SetBasicCredentials(config.User, config.Password); return config.IsAgainstCloudant() ? (IMyCouchServerClient)new MyCouchCloudantServerClient(new CustomCloudantServerClientConnection(uriBuilder.Build())) : (IMyCouchServerClient)new MyCouchServerClient(uriBuilder.Build()); }
private static IMyCouchClient CreateDbClient(string dbName) { var config = Environment; var uriBuilder = new MyCouchUriBuilder(config.ServerUrl) .SetDbName(dbName); if (config.HasCredentials()) uriBuilder.SetBasicCredentials(config.User, config.Password); return config.IsAgainstCloudant() ? new MyCouchCloudantClient(new CustomCloudantDbClientConnection(uriBuilder.Build())) : new MyCouchClient(uriBuilder.Build()); }
internal static IMyCouchServerClient CreateServerClient() { var config = Environment; var uriBuilder = new MyCouchUriBuilder(config.ServerUrl); if (config.HasCredentials()) { uriBuilder.SetBasicCredentials(config.User, config.Password); } return(config.IsAgainstCloudant() ? (IMyCouchServerClient) new MyCouchCloudantServerClient(new CustomCloudantServerClientConnection(uriBuilder.Build())) : (IMyCouchServerClient) new MyCouchServerClient(uriBuilder.Build())); }
private static IMyCouchClient CreateDbClient(string dbName) { var config = Environment; var uriBuilder = new MyCouchUriBuilder(config.ServerUrl) .SetDbName(dbName); if (config.HasCredentials()) { uriBuilder.SetBasicCredentials(config.User, config.Password); } return(config.IsAgainstCloudant() ? new MyCouchCloudantClient(new CustomCloudantDbClientConnection(uriBuilder.Build())) : new MyCouchClient(uriBuilder.Build())); }