BudgetAnalyser.Engine.Statement.TransactionGroupedByBucket.TransactionGroupedByBucket C# (CSharp) Méthode

TransactionGroupedByBucket() public méthode

Initializes a new instance of the TransactionGroupedByBucket class.
///
public TransactionGroupedByBucket ( [ transactions, [ groupByThisBucket ) : System
transactions [ The transactions.
groupByThisBucket [ The group by this bucket.
Résultat System
        public TransactionGroupedByBucket([NotNull] IEnumerable<Transaction> transactions,
                                          [NotNull] BudgetBucket groupByThisBucket)
        {
            if (transactions == null)
            {
                throw new ArgumentNullException(nameof(transactions));
            }

            if (groupByThisBucket == null)
            {
                throw new ArgumentNullException(nameof(groupByThisBucket));
            }

            Bucket = groupByThisBucket;
            Transactions =
                new ObservableCollection<Transaction>(
                    transactions.Where(t => t.BudgetBucket == groupByThisBucket).OrderBy(t => t.Date));
        }