/// <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); }
/// <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); }
PropertyValue IEntity.GetDirectValue(IProperty property) { return(InnerEntry.Has(property.Name) ? InnerEntry[property.Name].GetCurrentValue() : PropertyValue.Empty); }
bool IEntity.IsModified(string propertyName) { return(InnerEntry.Has(propertyName) && InnerEntry[propertyName].IsModified); }
PropertyValue IEntity.GetOldValue(IProperty property) { return(InnerEntry.Has(property.Name) ? InnerEntry[property.Name].GetOldValue() : PropertyValue.Empty); }