public async Task <IActionResult> OnGetAsync() { Couple = await GetAuthorizedCouple(); if (Couple == null) { return(NotFound()); } if (!Couple.Dinner.HasPrice) { return(Redirect(ModelPath.Get <Couples.EditCoupleModel>())); } var status = await Couple.UpdatePaymentStatus(); if (status.Changed) { await Database.SaveChangesAsync(); } PaymentStatus = status.NewStatus; return(Page()); }
public async Task <IActionResult> OnGetAsync() { Couple = await GetAuthorizedCouple(); if (Couple == null) { return(NotFound()); } var status = await Couple.UpdatePaymentStatus(); if (status.Changed) { await Database.SaveChangesAsync(); } return(Page()); }