Ejemplo n.º 1
0
        private void RemoveProperties(Identity id, ISchemaElement schemaEntity)
        {
            List <IDomainCommand> commands = new List <IDomainCommand>();

            // Suppression des propriétés
            foreach (var prop in schemaEntity.GetProperties(true))
            {
                // Pour chaque propriété qui n'est pas une relation, on va générer un événement spécifique
                if (prop.PropertySchema is ISchemaRelationship)
                {
                    continue;
                }

                var pnode = GetPropertyValue(id, prop);
                if (pnode != null)
                {
                    _trace.WriteTrace(TraceCategory.Hypergraph, "Remove property {0}.{1}", id, prop.Name);
                    commands.Add(new RemovePropertyCommand(_domainModel, id, schemaEntity.Id, prop));
                }
            }
            if (commands.Count > 0)
            {
                Session.Current.Execute(commands.ToArray());
            }
        }