Exemplo n.º 1
0
        public override string ToString()
        {
            var modified = new Dictionary <Charge, int>();

            Charges.ForEach(self =>
            {
                if (modified.ContainsKey(self))
                {
                    modified[self] += 1;
                }
                else
                {
                    modified.Add(self, 1);
                }
            });

            return($"{string.Join(", ", modified.Select(self => $"{self.Key} x{self.Value}"))} ({IssuedAt:MM/dd/yyyy HH:mm:ss})");
        }