Ejemplo n.º 1
0
        public virtual void When(IAttributeSetStateDeleted e)
        {
            ThrowOnWrongEvent(e);

            this.Deleted   = true;
            this.UpdatedBy = e.CreatedBy;
            this.UpdatedAt = e.CreatedAt;

            foreach (var innerState in this.AttributeUses)
            {
                this.AttributeUses.Remove(innerState);

                var innerE = e.NewAttributeUseStateRemoved(innerState.AttributeId);
                ((AttributeUseEventBase)innerE).CreatedAt = e.CreatedAt;
                ((AttributeUseEventBase)innerE).CreatedBy = e.CreatedBy;
                innerState.When(innerE);
                //e.AddAttributeUseEvent(innerE);
            }
        }