-
-
Save harry-gordon/30c10f5cafb199f1560eacd974d92f6e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class MyOrderController : RenderController | |
| { | |
| ... | |
| public override IActionResult Index() | |
| { | |
| ... | |
| if (orderId is not null) | |
| { | |
| // Since there's an order ID present we load it to | |
| // send the details to the view | |
| // (what's the worst that could happen) | |
| var orderPage = (MyOrder) CurrentPage; | |
| orderPage.Order = _ordersService.GetOrder(member); | |
| } | |
| // If we can't find the order we just don't set it | |
| // and the template will handle the null and say | |
| // Sorry, we couldn't find your order :( | |
| return CurrentTemplate(CurrentPage); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment