Ever been debugging and wanted to know what the result a function call would but calling it would change the state in a way that would make continuing difficult or impossible? Well, you can evaluate it and specify that it does not have any side effects.
Ever have code where you catch an exception because to handle it, but you don’t need to use the exception itself? Maybe just knowing the exception type is enough for you. But then you sometimes want to see it while debugging?
Previously I would just capture the exception and just live with the warning about an unused variable, but now I do this.
When you look at an object in the Watch window what you see is whatever comes out of the ToString() method. But what if you could control what was displayed so that you could see some meaningful value? Well, you can.
Occasionally you need to update a table with a random value per row. And thanks to some optimizations SQL Server does, it’s not exactly straight forward.
One thing I stumbled on with Blazor was how to create a layout that changed based on the data on the page. For example, you may want to include bread crumbs in the header of your page. You could get the URL and try to parse out where in the application from your MainLayout, and then figure out what you need to figure out to create your breadcrumbs. But ideally you’d have each page figure out it’s own breadcrumbs and pass that data to the header.