예제 #1
0
        public void SetSum([InjectGroup] Group group, string name, long?number)
        {
            if (!number.HasValue)
            {
                group.GetOrCreateValue <long>(name);
                return;
            }

            var value = group.GetOrCreateValue <long>(name);

            group.SetValue(name, value + number);
        }
예제 #2
0
        public void SetMin([InjectGroup] Group group, string name, decimal?value)
        {
            if (!value.HasValue)
            {
                group.GetOrCreateValue <decimal>(name);
                return;
            }

            var storedValue = group.GetOrCreateValue <decimal>(name);

            if (storedValue > value)
            {
                group.SetValue(name, value);
            }
        }
예제 #3
0
        public void SetSumOutcome([InjectGroup] Group group, string name, decimal?number)
        {
            if (!number.HasValue)
            {
                group.GetOrCreateValue <decimal>(name);
                return;
            }

            var value = group.GetOrCreateValue <decimal>(name);

            if (number < 0)
            {
                group.SetValue(name, value + number);
            }
        }
예제 #4
0
        public void SetCount([InjectGroup] Group group, string name, DateTimeOffset?value)
        {
            var values = group.GetOrCreateValue <int>(name);

            group.SetValue(name, values + 1);
        }
예제 #5
0
        public void SetStringAsNumericSum([InjectGroup] Group group, string name, string number)
        {
            var value = group.GetOrCreateValue <decimal>(name);

            group.SetValue(name, value + ToDecimal(number));
        }