public async Task <IActionResult> OnPostAsync(string walletId) { if (!ModelState.IsValid) { return(Page()); } Wallet = await _walletService.GetWallet(new WalletQuery { UserId = UserId, WalletId = walletId, IncludeTransactions = true }); if (Wallet == null) { return(NotFound()); } if (await TryUpdateModelAsync <Wallet>(Wallet, "wallet", w => w.Name)) { await _walletService.AddOrUpdateWallet(Wallet); return(RedirectToPage("./Index", new { walletId })); } return(Page()); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } Wallet = new Wallet { UserId = UserId }; if (await TryUpdateModelAsync <Wallet>(Wallet, "wallet", w => w.Name)) { await _walletService.AddOrUpdateWallet(Wallet); return(RedirectToPage("./Index", new { walletId = Wallet.WalletId })); } return(Page()); }