/// <summary> /// 添加 /// </summary> /// <typeparam name="TObject">领域对象类型</typeparam> /// <typeparam name="TProperty">属性类型</typeparam> /// <typeparam name="TValue">值类型</typeparam> /// <param name="expression">属性表达式。范例:t => t.Name</param> /// <param name="obj">领域对象</param> /// <param name="newValue">新值。范例:newEntity.Name</param> public void Add <TObject, TProperty, TValue>(Expression <Func <TObject, TProperty> > expression, TObject obj, TValue newValue) where TObject : IDomainObject { var member = Lambdas.GetMemberExpression(expression); var name = Lambdas.GetMemberName(member); var desc = Reflection.Reflections.GetDisplayNameOrDescription(member.Member); var value = member.Member.GetPropertyValue(obj); Add(name, desc, Conv.To <TValue>(value), newValue); }