Esempio n. 1
0
 public Session(Connection connection, string database)
 {
     InvalidDatabaseNameException.Validate(database);
     Connection = connection;
     Database   = database;
     Serializer = new EntitySerializer(this);
 }
Esempio n. 2
0
        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 + "/");
        }