public void Apply(T element, IEnumerable <T> elements) { var value = Enumerable.Max <T, TResult>(elements, (e) => (TResult)ReflectionTool.GetMemberValue(member, e)); ReflectionTool.SetMemberValue(member, element, Convert.ChangeType(value, typeof(TResult))); }
public void Apply(T element, IEnumerable <T> elements) { var value = Enumerable.Sum <T>(elements, (e) => (decimal)ReflectionTool.GetMemberValue(member, e)); ReflectionTool.SetMemberValue(member, element, Convert.ChangeType(value, ReflectionTool.GetTypeOf(member))); }