/// <summary> /// Substract a message property value from a property with the same name as in a projection /// </summary> /// <typeparam name="TMessage">A message type</typeparam> /// <typeparam name="TProjection">A projection type</typeparam> /// <typeparam name="TValue">A type of projection property</typeparam> /// <param name="source">An argument builder that contains resulting mapper</param> /// <param name="projectionProperty">An expression that identifies a projection property</param> /// <returns>An argument builder that contains resulting mapper</returns> public static IRegisterMappers <TMessage, TProjection> Substract <TMessage, TProjection, TValue>( this IRegisterMappers <TMessage, TProjection> source, Expression <Func <TProjection, TValue> > projectionProperty) where TValue : IComparable <TValue> { PropertyInfo propertyInfo = ReflectionHelpers.GetMessagePropertyInfo <TMessage, TProjection, TValue>(projectionProperty); return(source.Substract(projectionProperty, e => ReflectionHelpers.GetPropertyValue <TMessage, TValue>(e, propertyInfo))); }
/// <summary> /// Decrement a property value in a projection /// </summary> /// <typeparam name="TMessage">A message type</typeparam> /// <typeparam name="TProjection">A projection type</typeparam> /// <param name="source">An argument builder that contains resulting mapper</param> /// <param name="projectionProperty">An expression that identifies a projection property</param> /// <returns>An argument builder that contains resulting mapper</returns> public static IRegisterMappers <TMessage, TProjection> Decrement <TMessage, TProjection>( this IRegisterMappers <TMessage, TProjection> source, Expression <Func <TProjection, long> > projectionProperty) { return(source.Substract(projectionProperty, e => 1)); }