You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lab/part0-exploring-codebase.md
+4-6Lines changed: 4 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,15 +2,13 @@
2
2
3
3
GitHub Copilot Chat allows you to ask questions about your code and get intelligent responses.
4
4
5
-
1.[] Open the solution in Visual Studio 2022.
6
-
2. Click on the Github Copilot Chat in the top-right corner of Visual Studio and select **Open Chat Window** or press `Ctrl+\+C` if Copilot chat isn't open.
7
-
5
+
1.[] Open the solution in Visual Studio 2022 if it is not already open.
6
+
1. Click on the Github Copilot Chat in the top-right corner of Visual Studio and select **Open Chat Window** or press `Ctrl+\+C` if Copilot chat isn't open.
3.[] Try asking questions about the project structure:
8
+
1.[] Try asking questions about the project structure:
11
9
-`What projects are in this solution and how do things work together?`
12
10
-`What is the TinyShop application architecture?`
13
11
-`How does the Products API work?`
14
-
4.[] Notice how Copilot analyzes your codebase to provide contextual answers.
12
+
1.[] Notice how Copilot analyzes your codebase to provide contextual answers.
15
13
16
14
**Key Takeaway**: GitHub Copilot Chat helps you understand unfamiliar codebases by answering questions about the project structure, architecture, and implementation details.
Copy file name to clipboardExpand all lines: lab/part1-code-completion.md
+78-14Lines changed: 78 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,25 +4,27 @@ In this section, you'll use GitHub Copilot's code completion to implement API en
4
4
5
5
> IMPORTANT: For this exercise, **DO NOT** copy and paste the code snippet provided, but rather type it manually. This will allow you to experience code completion as you would if you were coding back at your desk. You'll likely see you only have to type a few characters before GitHub Copilot begins suggesting the rest.
6
6
7
-
1.[] Open **ProductEndpoints.cs** in the **Products** project under **Endpoints** - it should be empty or contain minimal code.
7
+
1.[] Stop debugging the appliaction if it is currently running.
8
+
9
+
1.[] In the Solution Explorer, in the **Products** project, open **Endpoints/ProductEndpoints.cs** - it will have a single endpoint implemented.
8
10
9
11
> Note: GitHub Copilot will not give code suggestions when debugging.
10
12
11
-
2.[]Begin typing a comment to describe what you want to implement:
13
+
1.[]Let's implement a new **MapGet**to get product details for a specific **id**. Move our cursor and click on line 20 under the existing **/** endpoint. Text suggestion may apprear or type:
- Ask the agent: `Can you implement the rest of the endpoints for the Product API and also implement the ProductService to call these new endpoints in the Store project?`
36
38
37
-
Theendcodesouldlooksimilarto:
39
+
The end code in **ProductEndpoints.cs**sould look similar to:
38
40
39
41
```csharp
40
42
group.MapGet("/", async (ProductDataContextdb) =>
@@ -96,22 +98,84 @@ In this section, you'll use GitHub Copilot's code completion to implement API en
96
98
.Produces(StatusCodes.Status404NotFound);
97
99
```
98
100
101
+
In the **Store** project in the solution explorer open **Services/ProductService.cs**, the code sould look similar to:
>Because LLMs are probabilistic, not deterministic, the exact code generated can vary. The above is a representative example. If your code is different, that's just fine as long as it works!
1.[]Go back to **ProductEndpoints.cs**, and try changing the variable name of **id** to `productId` in the new **MapGet** method and see Next Edit Suggestions help out.
103
167
104
168

105
169
106
-
8. [] Tryusingdocumentationgeneration:
170
+
1.[] Try using documentation generation:
107
171
- Type `///` above a method to generate XML documentation on the **MapProductEndpoints** this can also be brought up with `Alt+/` for inline and then entering **/** which will bring up a list of commands.
108
172
109
173

110
174
111
-
9. [] Testyourimplementation:
175
+
1.[] Test your implementation:
112
176
- Run the AppHost project.
113
177
- Test your new endpoints by going to **https://localhost:7130/api/Product/1**
114
178
115
-
10. [] Stopdebuggingandclosetheapplication
179
+
1.[] Stop debugging and close the application
116
180
117
181
**Key Takeaway**: GitHub Copilot can generate complete API implementations based on your comments or partial code, significantly speeding up development.
Copy file name to clipboardExpand all lines: lab/part2-enhancing-ui.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,24 +5,24 @@ Now, you'll improve the loading experience using Copilot's inline chat.
5
5
> [!NOTE]
6
6
> This exercise does supply specific prompts to type, but as part of the learning experience we encourage you to discover how to interact with Copilot. Feel free to talk in natural language, describing what you're looking for or need to accomplish.
7
7
8
-
1.[]Open **Products.razor**in the **Store** project under**Components**.
9
-
2.[] Find the "Loading..." text in the code.
10
-
3.[] Select this text and right-click.
11
-
4.[] Choose "Copilot > Start inline chat" or press `Alt+/`.
12
-
5.[] In the inline chat, type: "What would this look like with a loading progress spinner"
8
+
1.[]In the **Solution explorer**under the **Store** project open**Components/Pages/Products.razor**.
9
+
1.[] Find the "Loading..." text in the code.
10
+
1.[] Select this text and right-click.
11
+
1.[] Choose "Ask Copilot" or press `Alt+/`.
12
+
1.[] In the inline chat, type: "Update this to have a loading progress spinner and the text: Loading... under it"
13
13
14
14

15
15
16
-
6.[] Preview the suggestion by clicking the "Preview" button.
17
-
7.[] Accept the change by clicking "Accept."
16
+
1.[] Select **Tab** to accept the changes, and it should look similar to:
Copy file name to clipboardExpand all lines: lab/part3-referencing-files.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,12 @@
2
2
3
3
In this section, you'll learn how to reference existing code files in your chat conversations.
4
4
5
-
1.[] Open **Products.razor** from the Store project.
6
-
1.[] Ensure that GitHub Copilto Chat is open by clickin on the Github Copilot Chat in the top-right corner of Visual Studio and select **Open Chat Window** or press `Ctrl+\+C` if Copilot chat isn't open.
5
+
1.[] Open the **Products.razor**again from the **Store** project.
6
+
1.[] Ensure that GitHub Copilto Chat is open by clicking on the Github Copilot Chat in the top-right corner of Visual Studio and select **Open Chat Window** or press `Ctrl+\+C` if Copilot chat isn't open.
Copy file name to clipboardExpand all lines: lab/part5-implementing-features.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@ With Copilot Agent, you will add the files which need to be updated to the conte
7
7
Let's add the ability to see a list of images into the app:
8
8
9
9
1.[] Open GitHub Copilot Chat in the top-right corner of Visual Studio and select **Open Chat Window** or press `Ctrl+\+C` if Copilot chat isn't open.
10
+
10
11
1.[] Switch to **Agent** mode.
11
12
12
13

@@ -15,7 +16,10 @@ Let's add the ability to see a list of images into the app:
15
16
16
17

17
18
18
-
1.[] If available, select **Claude 3.5 Sonnet** from the list of available models
19
+
1.[] At the bottom of the GitHub Copilot Chat pane, select the model (default is GPT-4o") from the dropdown list, and select **Claude 3.5 Sonnet** from the list of available models.
20
+
21
+

22
+
19
23
1.[] Type: `Implement a product listing page in Products.razor that fetches products from #ProductService and displays them in a list with product name, description, price, and image.`
Copy file name to clipboardExpand all lines: lab/part6-copilot-vision.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,13 +3,13 @@
3
3
In this section, you'll use Copilot Vision. You can share screenshots of errors and Copilot will interpret the image and resolve the issue. Or share mockups of new designs, and Vision will help you bring them to life. Let's update our design based on a photo our design gave us.
4
4
5
5
1.[] Open a new Copilot Chat thread in Agent mode.
6
-
2.[] Click the **+** button in the chat, select **upload image**, and select the store application image that is found in the GitHub repo that is cloned called **eshop.png** inside of the **C:\Users\LabUser\Source\Repos\build-2025-lab300** directory.
6
+
1.[] Click the **+** button in the chat, select **upload image**, and select the store application image that is found in the GitHub repo that is cloned called **eshop.png** inside of the **C:\Users\LabUser\Source\Repos\build-2025-lab300** directory.
7
7
8
8

9
9
10
-
3.[] Ask: `Update the Products.razor to display products in a grid layout similar to this image. Add nice hover effects and make it responsive.`
11
-
4.[] Review the suggested code changes and implement them. It should recommend changes to both the **Products.razor** and a new **Products.razor.css**
12
-
5.[] Run the application to see the updated product grid layout. You may have to clear the browser cashe with CTRL+SHIFT+R if you don't see the css update.
10
+
1.[] Ask: `Update the Products.razor to display products in a grid layout similar to this image. Add nice hover effects and make it responsive.`
11
+
1.[] Review the suggested code changes and implement them. It should recommend changes to both the **Products.razor** and a new **Products.razor.css**
12
+
1.[] Run the application to see the updated product grid layout. You may have to clear the browser cashe with CTRL+SHIFT+R if you don't see the css update.
13
13
14
14
> Note: continue to iterate with Copilot Agent if it isn't to your liking.
0 commit comments