Exemple #1
0
        public async Task BeforeCreate(BudgetContext context)
        {
            var category = await context.FindAsync <ExpenseCategory>(ExpenseCategory?.ID ?? ExpenseCategoryId)
                           ?? throw new InvalidOperationException("Could not find expense category for item");

            category.CurrentBalance += Amount;
        }
Exemple #2
0
        public async Task BeforeRemove(BudgetContext context)
        {
            var category = await context.FindAsync <ExpenseCategory>(ExpenseCategoryId);

            category.CurrentBalance -= Amount;
        }