Ejemplo n.º 1
0
        internal DatabaseObject(string table, string key, string version, List <ObjectProperty> properties)
        {
            this.Table            = table;
            this.Key              = key;
            this.Version          = version;
            this.Properties       = new Dictionary <string, object>();
            this.ExistsInDatabase = true;

            if (properties != null)
            {
                this.Properties = (DatabaseObjectExtensions.FromDictionary(DatabaseObjectExtensions.ToDictionary(properties)) as DatabaseObject).Properties;
            }
        }
Ejemplo n.º 2
0
 public void CreateObject(string table, string key, DatabaseObject obj)
 {
     File.WriteAllText(Path.Combine(this.StorageLocation, table, key + ".tson"), TsonConvert.SerializeObject(DatabaseObjectExtensions.ToDictionary(obj.Properties), Formatting.Indented));
 }