示例#1
0
        void IEntity.NotifyModified(string propertyName)
        {
            InnerEntry.Modify(propertyName);

            if (state == EntityState.Unchanged)
            {
                state = EntityState.Modified;
            }

            if (owner != null)
            {
                owner.Parent.As <IEntity>(s => s.NotifyModified(owner.Property == null ? string.Empty : owner.Property.Name));
            }
        }
示例#2
0
        /// <summary>
        /// 内部设置属性值的方法。
        /// </summary>
        /// <param name="property"></param>
        /// <param name="value"></param>
        private void InternalSetValue(IProperty property, PropertyValue value)
        {
            if (PropertyValue.IsEmpty(value))
            {
                if (SetNullable(property))
                {
                    return;
                }
            }

            if (property is RelationProperty)
            {
                InnerLazyMgr.SetValueCreated(property.Name);
            }

            InnerEntry.Modify(property.Name, value);
        }
示例#3
0
        void IEntityRelation.NotifyModified(string propertyName)
        {
            if (!string.IsNullOrEmpty(propertyName))
            {
                InnerEntry.Modify(propertyName);
            }

            if (_state == EntityState.Unchanged)
            {
                _state = EntityState.Modified;
            }

            //修改父对象的状态
            if (_owner != null)
            {
                _owner.Parent.As <IEntityRelation>(s => s.NotifyModified(_owner.Property == null ? string.Empty : _owner.Property.Name));
            }
        }
示例#4
0
        void IEntity.NotifyModified(string propertyName, bool modified)
        {
            if (!modified)
            {
                InnerEntry.Modify(propertyName, false);
                return;
            }

            InnerEntry.Modify(propertyName, modified);

            if (_state == EntityState.Unchanged)
            {
                _state = EntityState.Modified;
            }

            if (_owner != null)
            {
                _owner.Parent.As <IEntity>(s => s.NotifyModified(_owner.Property == null ? string.Empty : _owner.Property.Name));
            }
        }