public Session(Connection connection, string database) { InvalidDatabaseNameException.Validate(database); Connection = connection; Database = database; Serializer = new EntitySerializer(this); }
public string GetDatabaseLocation(string database) { InvalidDatabaseNameException.Validate(database); var uri = new Uri(Location, database); var location = uri.OriginalString; if (database.Contains("/") && location.EndsWith(database)) { var escaped = database.Replace("/", "%2F"); location = location.Substring(0, location.Length - database.Length) + escaped; } return(location.EndsWith("/") ? location : location + "/"); }