public async Task <IActionResult> OnGetAsync(int?id, DateTime?duplicateDateError, [FromQuery] BillPayPaging paging)
        {
            if (id == null)
            {
                return(NotFound());
            }

            CurrentPaymentPage = paging.PaymentPage ?? 1;
            CurrentBillPage    = paging.BillPage ?? 1;
            CurrentExpensePage = paging.ExpensePage ?? 1;

            if (duplicateDateError != null)
            {
                DuplicateDateError = duplicateDateError;
            }

            BillPay = await _billPayService.GetByIdAsync((int)id);

            if (BillPay == null)
            {
                return(NotFound());
            }

            //Bills pagination
            int totalUpcomingBills = await _billService.CountUpcomingBillsAsync();

            TotalBillPages = (int)Math.Ceiling(((float)totalUpcomingBills / 20));
            UpcomingBills  = await _billService.GetUpcomingBillsAsync((CurrentBillPage - 1) * 20, 20);

            //Payments pagination
            int totalPayments = await _paymentService.CountPaymentsByBillPayAsync(BillPay.ID);

            TotalPaymentPages = (int)Math.Ceiling(((float)totalPayments / 8));
            BillPay.Payments  =
                await _paymentService.GetPaymentsByBillPayAsync(BillPay.ID, (CurrentPaymentPage - 1) * 8, 8);

            //Expenses pagination
            int totalExpenses = await _expenseService.CountExpensesByBillPayAsync(BillPay.ID);

            TotalExpensePages = (int)Math.Ceiling(((float)totalExpenses / 8));
            BillPay.Expenses  = await _expenseService.GetExpensesByBillPayAsync(BillPay.ID, (CurrentExpensePage - 1) * 8, 8);

            if (BillPay == null)
            {
                return(NotFound());
            }
            return(Page());
        }