Пример #1
0
        public override void Execute(CollectionMap map)
        {
            var sdb = map.Profile[this._filename];

            if (sdb is null)
            {
                throw new LookupFailException($"File {this._filename} was never loaded");
            }

            var manager = sdb.Database.GetManager(this._manager);

            if (manager is null)
            {
                throw new LookupFailException($"Manager named {this._manager} does not exist");
            }

            manager.Remove(this._collection);
            map.RemoveCollection(this._filename, this._manager, this._collection);
        }
Пример #2
0
        public override void Execute(CollectionMap map)
        {
            var collection = map.GetCollection(this._filename, this._manager, this._collection);

            if (this._expand is null)
            {
                collection.SetValue(this._property, this._value);

                if (this._property == "CollectionName")
                {
                    map.RemoveCollection(this._filename, this._manager, this._collection);
                    map.AddCollection(this._filename, this._manager, this._value, collection);
                }
            }
            else
            {
                var part = collection.GetSubPart(this._subpart, this._expand);
                if (part == null)
                {
                    throw new Exception($"SubPart named {this._subpart} in node {this._expand} does not exist");
                }
                part.SetValue(this._property, this._value);
            }
        }