RSS DEV Community

VS2022 IEnumerable visualizer

Starting in Visual Studio 2022 version 17.11, developers can modify the Expression textbox for the IEnumerable visualizer with a modified LINQ expression or ask a question about the data at a breakpoint. This feature allows developers to ask questions about a variable in a debugging session without stopping and writing another LINQ/Lambda statement. Using this feature can save time and teach developers new techniques. The examples provided are intermediate to advanced and assume expertise in C#. The first example uses EF Core to read data from a SQL Server database and demonstrates how to ask questions about the data using the visualizer. The second example uses interfaces and classes to demonstrate filtering and ordering data using the visualizer. The visualizer can be used to ask complex questions about the data, such as filtering by date range or specific properties. If an error occurs, retrying the question may work if it's a valid question for the data. The source code for both examples is provided. The IEnumerable visualizer is a powerful tool that can save time in debugging sessions, and developers should take the time to become familiar with it.
dev.to
dev.to
VS2022 IEnumerable visualizer
Create attached notes ...