Пример #1
0
    // modify this method as shown
    public MyImmutable Apply(Func <decimal, decimal, decimal> aggFunc, MyImmutable y)
    {
        var aggregated = new Dictionary <ImmutableKey, decimal>(AllKeys.Count());

        foreach (ImmutableKey bt in AllKeys)
        {
            aggregated[bt] = aggFunc(this[bt], y[bt]);
        }
        return(GetNew(aggregated));
    }