Пример #1
0
        /// <summary>
        /// 检查并懒加载属性的值。
        /// </summary>
        /// <param name="property"></param>
        /// <returns></returns>
        private PropertyValue CheckAndLazyPropertyValue(IProperty property)
        {
            var value = PropertyValue.Empty;

            if (InnerEntry.Has(property.Name))
            {
                value = InnerEntry[property.Name].GetOldValue();
            }

            return(PropertyValue.IsEmpty(value) ? ProcessSupposedProperty(property) : value);
        }
Пример #2
0
        /// <summary>
        /// 检查是否有原值相等。
        /// </summary>
        /// <param name="property"></param>
        /// <param name="value"></param>
        /// <param name="oldValue"></param>
        /// <returns></returns>
        private bool CheckValueEquals(IProperty property, PropertyValue value, out PropertyValue oldValue)
        {
            if (InnerEntry.Has(property.Name) &&
                (oldValue = (this as IEntity).GetDirectValue(property)) != null)
            {
                oldValue.InitializeInstanceName(string.Empty);
                return(value == oldValue);
            }

            oldValue = PropertyValue.Empty;

            return(false);
        }
Пример #3
0
 PropertyValue IEntity.GetDirectValue(IProperty property)
 {
     return(InnerEntry.Has(property.Name) ? InnerEntry[property.Name].GetCurrentValue() : PropertyValue.Empty);
 }
Пример #4
0
 bool IEntity.IsModified(string propertyName)
 {
     return(InnerEntry.Has(propertyName) && InnerEntry[propertyName].IsModified);
 }
Пример #5
0
 PropertyValue IEntity.GetOldValue(IProperty property)
 {
     return(InnerEntry.Has(property.Name) ? InnerEntry[property.Name].GetOldValue() : PropertyValue.Empty);
 }