 Hello, Syed Hashimi here, back with another Visual Studio for Mac tips and tricks video. In today's video, I'm going to show you how you can improve your productivity using the Navigate 2 feature. Navigate 2 is kind of similar to the Quick Launch feature that you might have used in Visual Studio for Windows. And I'm going to demonstrate this to you today by working on an existing ASP.NET Core web app that I've created previously. Okay, so first, let me introduce you to Navigate 2. Navigate 2 is found here at the top right-hand corner of Visual Studio for Mac. And using Navigate 2, you can explore your solution, your IDE, run commands, and more. And if I expand this dropdown, you can see that Navigate 2 has special support for files, types, members, and commands. And we're going to go through each one of those in the video today. All right, let me introduce you to the application that we're going to be working on today. It's a solution that consists of four projects. We've got an ASP.NET Core web API project, a shared class library, and then an ASP.NET Core razor web pages project. I've got the application running here, so let me go ahead and switch to the browser and I'll show you that. So this is a web application that's available that will show you the different templates that are available for .NET new. And you can visit this web application by going to .NET new.azurewebsites.net. All right, so as I'm looking through here, basically each one of these headings represents a NuGet package that consists of one or more templates. In the template world, we call these template packs. And as I'm browsing this website, I can see that there must be some sort of a bug here because on certain lines I'm seeing empty bullet points here. So that's what we're going to take a look at today and we're going to go and try and fix that. And we're going to try to use Navigate 2 during this process. So now I'll switch back to Visual Studio for Mac and we'll get started. The first thing I need to do is stop the application which is running. And to get to Navigate 2, you can also use the keyboard shortcut command dot, which I'll mostly be using today. All right, so first I want to stop the application. So I'm simply going to press stop here. All right, so I invoke stop and we can see that the stop button has turned into a play button again. All right, so now we've stopped the application and we need to try and figure out how can we fix this bug. Let me give you kind of a high level overview of what this application does. So we've got a razor web pages application that calls into an API project. And by default on the index page, it's going to make a call into the API project to get the result of the template packs which are available. And that's what I want to look for. That's where I want to start looking for my debugging is inside that API call. So now I want to navigate to the controller that's responsible for that. And I'm going to search for a type here. So I'll prefix it with T and say template pack controller. All right, that's the controller that's called when the API goes to the template packs page. And the git method here is basically what's going to be called. So we can see that it returns template packs. And in the constructor, the template packs are initialized by calling template pack create from file. So I can right click create from file and go to declaration if I wanted to. But I can also do a similar thing with navigate to I can say I'm looking for a member called create from file. Okay, so we go to create from file. This is where we're at. And if I was to go through and look through here, we can see that create from file. It will get the JSON result of the template report and then create an object based from that. And the the main call is here create from text. So what I want to do is I want to go and I want to go ahead and start debugging my application. And then I'll show you how we can stop at this point. So I'll use command dot. And then I'm going to run a command that's that's that's called start. So we'll say start debugging. We'll go ahead and let the word go ahead and let the debugger start here. And then what I'll do is I'll set a I'll set a breakpoint and create from file. And then we'll refresh the browser. Wait for that breakpoint to get hit. All right, so now what I'll do is I'll go down to create from text. And then I'm going to execute another command called called run to cursor. Run to cursor. So this will bring the debugger all the way down to the line that's currently selected. So now let's go ahead and inspect the result here and see if there's any problems that might result in those empty bullet points. So we have the list of template packs. And now we want to go and inspect the templates that are available for these. So let me go into the first template pack. Here we can see we've got the single page application templates for ASP.NET Core. And if I drill into the templates list and then expand out the first one, I can see now I have a list of values here, which is essentially empty. So they're null. And then the second one has actual content. And then if I expand the third one, we're seeing more nulls here again. So this is obviously the problem. So let me go ahead and stop debugging. So I'll do command dot C stop. Now we've stopped debugging. So what we need to do is filter the result and don't include any templates which are essentially empty. I've created a snippet that I'm going to invoke that will solve this problem for us. So here we've got the code and we're going to filter out and remove any template which does not have a name. All right, so hopefully that's going to fix our problem. Let me go ahead and start debugging the application again. I'm going to remove this break point. Go down to toggle break point and then continue. All right, here we can see the application is now running. And we have successfully removed the empty bullet points that were here previously. All right, so now we fix that bug. So let me go back to Visual Studio for Mac. I'll stop debugging again. And now we're pretty much ready. We've made this bug fix. Now we need to go ahead and commit it back to our repository. We'll do a SQL and commit, expand the modified to take a look at the results. We can see that's correct. It looks good. I'm going to go ahead and click commit here. Okay, so now I've committed that bug fix and we're ready to go. We could also push that to a remote repository if we wanted to, but I'm not going to do that here for this case. So now let me go back to navigate to, and I'll show you some other kind of neat features which are available there. We can see that from the way that we fixed this particular bug, we took the result from deserialized object from the template report and then just kind of filtered out those templates. But let's go take a look at that file and see if those nulls are present there or is there some other bug as well. And I can't remember where I have that file, but I do remember that inside the file there was a property called extract path and that's pretty unique. So let me go and search for that. So I'm going to use navigate to for that. So I'll say extract path. And then I'll select search and solution. All right, so here's the results that are found. Here's my template report. And as we can see, there are null entries here and this application just consumes this template report. It doesn't actually generate it. So we're not able to actually fix that problem here, but at least we know there's no additional bug inside the application itself. All right, now let's take a look at some other features that we can invoke from the navigate to. So I'll go back into it. And let's say now we want to add a NuGet package to this project. For example, if I want to add the AutoMapper NuGet package, I can search for the name AutoMapper and then go down to search packages. Then I could select AutoMapper or whatever other packages I might want to add and then select add package. Okay, so now it has successfully installed the AutoMapper package into my project and now we're good to go to start consuming that and adding that to the project there. In this video, we've seen how you can increase your productivity using the navigate to feature in Visual Studio for Mac. Specifically, we've talked about how you can search through files, types, members, commands and more. I'm Sayed Hashimi. Keep an eye out for any future videos in this Visual Studio for Mac tips and tricks series. Thank you. Have a nice day.