Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
author: tdykstra
ms.author: wpickett
ms.date: 09-21-2025
ms.date: 10-16-2025
---

# Copilot Instructions for `dotnet/AspNetCore.Docs`
Expand Down Expand Up @@ -78,6 +78,7 @@ When working on an issue:

## Repository-Specific Guidelines
- [ ] Follow the [Microsoft Writing Style Guide](https://learn.microsoft.com/en-us/style-guide/welcome/)
- [ ] Use contractions following the guidance in [Use contractions](https://learn.microsoft.com/en-us/style-guide/word-choice/use-contractions)
- [ ] **Repository Exceptions**:
- [ ] Number ordered lists as "1." for every item (don't use sequential numbers)
- [ ] Use backticks around content specifically for file names (`file.txt`), folders (`folder`), file paths (`folder/file.txt`), custom types (`myVariable`, `MyClass`), raw URLs in the text (`https://www.contoso.com`), URL segments (`/product/id/199`), file extensions (`.razor`), NuGet packages (`Microsoft.AspNetCore.SignalR.Client`), and code that should never be localized
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public async Task<IActionResult> OnPostAsync()
return RedirectToPage("./Index");
}

// Select DepartmentID if TryUpdateModelAsync fails.
// Repopulate departments dropdown. emptyCourse.DepartmentID determines the selected item.
PopulateDepartmentsDropDownList(_context, emptyCourse.DepartmentID);
return Page();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public async Task<IActionResult> OnGetAsync(int? id)
return NotFound();
}

// Select current DepartmentID.
// Populate departments dropdown. Course.DepartmentID determines the selected item.
PopulateDepartmentsDropDownList(_context, Course.DepartmentID);
return Page();
}
Expand Down Expand Up @@ -60,7 +60,7 @@ public async Task<IActionResult> OnPostAsync(int? id)
return RedirectToPage("./Index");
}

// Select DepartmentID if TryUpdateModelAsync fails.
// Repopulate departments dropdown. courseToUpdate.DepartmentID determines the selected item.
PopulateDepartmentsDropDownList(_context, courseToUpdate.DepartmentID);
return Page();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public async Task<IActionResult> OnPostAsync()
return RedirectToPage("./Index");
}

// Select DepartmentID if TryUpdateModelAsync fails.
// Repopulate departments dropdown. emptyCourse.DepartmentID determines the selected item.
PopulateDepartmentsDropDownList(_context, emptyCourse.DepartmentID);
return Page();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public async Task<IActionResult> OnGetAsync(int? id)
return NotFound();
}

// Select current DepartmentID.
// Populate departments dropdown. Course.DepartmentID determines the selected item.
PopulateDepartmentsDropDownList(_context,Course.DepartmentID);
return Page();
}
Expand All @@ -55,7 +55,7 @@ public async Task<IActionResult> OnPostAsync(int? id)
return RedirectToPage("./Index");
}

// Select DepartmentID if TryUpdateModelAsync fails.
// Repopulate departments dropdown. courseToUpdate.DepartmentID determines the selected item.
PopulateDepartmentsDropDownList(_context, courseToUpdate.DepartmentID);
return Page();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public async Task<IActionResult> OnPostAsync()
return RedirectToPage("./Index");
}

// Select DepartmentID if TryUpdateModelAsync fails.
// Repopulate departments dropdown. emptyCourse.DepartmentID determines the selected item.
PopulateDepartmentsDropDownList(_context, emptyCourse.DepartmentID);
return Page();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public async Task<IActionResult> OnGetAsync(int? id)
return NotFound();
}

// Select current DepartmentID.
// Populate departments dropdown. Course.DepartmentID determines the selected item.
PopulateDepartmentsDropDownList(_context, Course.DepartmentID);
return Page();
}
Expand All @@ -61,7 +61,7 @@ public async Task<IActionResult> OnPostAsync(int? id)
return RedirectToPage("./Index");
}

// Select DepartmentID if TryUpdateModelAsync fails.
// Repopulate departments dropdown. courseToUpdate.DepartmentID determines the selected item.
PopulateDepartmentsDropDownList(_context, courseToUpdate.DepartmentID);
return Page();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public async Task<IActionResult> OnPostAsync()
return RedirectToPage("./Index");
}

// Select DepartmentID if TryUpdateModelAsync fails.
// Repopulate departments dropdown. emptyCourse.DepartmentID determines the selected item.
PopulateDepartmentsDropDownList(_context, emptyCourse.DepartmentID);
return Page();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public async Task<IActionResult> OnGetAsync(int? id)
return NotFound();
}

// Select current DepartmentID.
// Populate departments dropdown. Course.DepartmentID determines the selected item.
PopulateDepartmentsDropDownList(_context, Course.DepartmentID);
return Page();
}
Expand All @@ -61,7 +61,7 @@ public async Task<IActionResult> OnPostAsync(int? id)
return RedirectToPage("./Index");
}

// Select DepartmentID if TryUpdateModelAsync fails.
// Repopulate departments dropdown. courseToUpdate.DepartmentID determines the selected item.
PopulateDepartmentsDropDownList(_context, courseToUpdate.DepartmentID);
return Page();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public async Task<IActionResult> OnPostAsync()
return RedirectToPage("./Index");
}

// Select DepartmentID if TryUpdateModelAsync fails.
// Repopulate departments dropdown. emptyCourse.DepartmentID determines the selected item.
PopulateDepartmentsDropDownList(_context, emptyCourse.DepartmentID);
return Page();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public async Task<IActionResult> OnGetAsync(int? id)
return NotFound();
}

// Select current DepartmentID.
// Populate departments dropdown. Course.DepartmentID determines the selected item.
PopulateDepartmentsDropDownList(_context, Course.DepartmentID);
return Page();
}
Expand Down Expand Up @@ -60,7 +60,7 @@ public async Task<IActionResult> OnPostAsync(int? id)
return RedirectToPage("./Index");
}

// Select DepartmentID if TryUpdateModelAsync fails.
// Repopulate departments dropdown. courseToUpdate.DepartmentID determines the selected item.
PopulateDepartmentsDropDownList(_context, courseToUpdate.DepartmentID);
return Page();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public async Task<IActionResult> OnPostAsync()
return RedirectToPage("./Index");
}

// Select DepartmentID if TryUpdateModelAsync fails.
// Repopulate departments dropdown. emptyCourse.DepartmentID determines the selected item.
PopulateDepartmentsDropDownList(_context, emptyCourse.DepartmentID);
return Page();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public async Task<IActionResult> OnGetAsync(int? id)
return NotFound();
}

// Select current DepartmentID.
// Populate departments dropdown. Course.DepartmentID determines the selected item.
PopulateDepartmentsDropDownList(_context, Course.DepartmentID);
return Page();
}
Expand Down Expand Up @@ -60,7 +60,7 @@ public async Task<IActionResult> OnPostAsync(int? id)
return RedirectToPage("./Index");
}

// Select DepartmentID if TryUpdateModelAsync fails.
// Repopulate departments dropdown. courseToUpdate.DepartmentID determines the selected item.
PopulateDepartmentsDropDownList(_context, courseToUpdate.DepartmentID);
return Page();
}
Expand Down
14 changes: 8 additions & 6 deletions aspnetcore/data/ef-rp/update-related-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ Create a `Pages/Courses/DepartmentNamePageModel.cs` file with the following code

[!code-csharp[](intro/samples/cu50/Pages/Courses/DepartmentNamePageModel.cs)]

The preceding code creates a <xref:Microsoft.AspNetCore.Mvc.Rendering.SelectList> to contain the list of department names. If `selectedDepartment` is specified, that department is selected in the `SelectList`.
The preceding code creates a <xref:Microsoft.AspNetCore.Mvc.Rendering.SelectList> to contain the list of department names. The `selectedDepartment` parameter allows the calling code to specify the item that will be selected when the drop-down list is rendered. However, when using the Select Tag Helper with `asp-for`, the selected item is determined by the model property value (such as `Course.DepartmentID`), not by the `selectedDepartment` parameter.

> [!IMPORTANT]
> When using the Select Tag Helper with `asp-for="Course.DepartmentID"`, the selected option is automatically determined by the value of `Course.DepartmentID`. The `selectedDepartment` parameter passed to the SelectList constructor is ignored in this scenario.
The Create and Edit page model classes will derive from `DepartmentNamePageModel`.

### Update the Course Create page model
Expand Down Expand Up @@ -77,7 +79,7 @@ Update `Pages/Courses/Edit.cshtml.cs` with the following code:

[!code-csharp[](intro/samples/cu50/Pages/Courses/Edit.cshtml.cs?highlight=8,28,35,36,40-66)]

The changes are similar to those made in the Create page model. In the preceding code, `PopulateDepartmentsDropDownList` passes in the department ID, which selects that department in the drop-down list.
The changes are similar to those made in the Create page model. In the preceding code, `PopulateDepartmentsDropDownList` passes in the department ID. When using the Select Tag Helper with `asp-for="Course.DepartmentID"`, the selected item in the drop-down list is determined by the value of `Course.DepartmentID`, not by the `selectedDepartment` parameter passed to the SelectList constructor.

### Update the Course Edit Razor page

Expand Down Expand Up @@ -253,7 +255,7 @@ Create a `Pages/Courses/DepartmentNamePageModel.cs` file with the following code

[!code-csharp[](intro/samples/cu30/Pages/Courses/DepartmentNamePageModel.cs)]

The preceding code creates a <xref:Microsoft.AspNetCore.Mvc.Rendering.SelectList> to contain the list of department names. If `selectedDepartment` is specified, that department is selected in the `SelectList`.
The preceding code creates a <xref:Microsoft.AspNetCore.Mvc.Rendering.SelectList> to contain the list of department names. The `selectedDepartment` parameter allows the calling code to specify the item that will be selected when the drop-down list is rendered. However, when using the Select Tag Helper with `asp-for`, the selected item is determined by the model property value (such as `Course.DepartmentID`), not by the `selectedDepartment` parameter.

The Create and Edit page model classes will derive from `DepartmentNamePageModel`.

Expand Down Expand Up @@ -300,7 +302,7 @@ Update `Pages/Courses/Edit.cshtml.cs` with the following code:

[!code-csharp[](intro/samples/cu30/Pages/Courses/Edit.cshtml.cs?highlight=8,28,35,36,40-66)]

The changes are similar to those made in the Create page model. In the preceding code, `PopulateDepartmentsDropDownList` passes in the department ID, which selects that department in the drop-down list.
The changes are similar to those made in the Create page model. In the preceding code, `PopulateDepartmentsDropDownList` passes in the department ID. When using the Select Tag Helper with `asp-for="Course.DepartmentID"`, the selected item in the drop-down list is determined by the value of `Course.DepartmentID`, not by the `selectedDepartment` parameter passed to the SelectList constructor.

### Update the Course Edit Razor page

Expand Down Expand Up @@ -470,7 +472,7 @@ The Courses/Create and Courses/Edit pages each need a list of department names.

[!code-csharp[](intro/samples/cu/Pages/Courses/DepartmentNamePageModel.cshtml.cs?highlight=9,11,20-21)]

The preceding code creates a <xref:Microsoft.AspNetCore.Mvc.Rendering.SelectList> to contain the list of department names. If `selectedDepartment` is specified, that department is selected in the `SelectList`.
The preceding code creates a <xref:Microsoft.AspNetCore.Mvc.Rendering.SelectList> to contain the list of department names. The `selectedDepartment` parameter allows the calling code to specify the item that will be selected when the drop-down list is rendered. However, when using the Select Tag Helper with `asp-for`, the selected item is determined by the model property value (such as `Course.DepartmentID`), not by the `selectedDepartment` parameter.

The Create and Edit page model classes will derive from `DepartmentNamePageModel`.

Expand Down Expand Up @@ -517,7 +519,7 @@ Replace the code in `Pages/Courses/Edit.cshtml.cs` with the following code:

[!code-csharp[](intro/samples/cu/Pages/Courses/Edit.cshtml.cs?highlight=8,28,35,36,40,47-999)]

The changes are similar to those made in the Create page model. In the preceding code, `PopulateDepartmentsDropDownList` passes in the department ID, which select the department specified in the drop-down list.
The changes are similar to those made in the Create page model. In the preceding code, `PopulateDepartmentsDropDownList` passes in the department ID. When using the Select Tag Helper with `asp-for="Course.DepartmentID"`, the selected item in the drop-down list is determined by the value of `Course.DepartmentID`, not by the `selectedDepartment` parameter passed to the SelectList constructor.

Update `Pages/Courses/Edit.cshtml` with the following markup:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Discover how to enhance an ASP.NET Core app from an external assemb
monikerRange: '>= aspnetcore-2.1'
ms.author: tdykstra
ms.custom: mvc
ms.date: 09/26/2019
ms.date: 09/04/2025
uid: fundamentals/configuration/platform-specific-configuration
---
# Use hosting startup assemblies in ASP.NET Core
Expand Down Expand Up @@ -336,6 +336,9 @@ deployment/additionalDeps/shared/Microsoft.AspNetCore.App/3.0.0/StartupDiagnosti

For runtime to discover the runtime store location, the additional dependencies file location is added to the `DOTNET_ADDITIONAL_DEPS` environment variable.

> [!NOTE]
> The `DOTNET_ADDITIONAL_DEPS` environment variable only works with framework-dependent applications. This environment variable is ignored for self-contained applications.

In the sample app (*RuntimeStore* project), building the runtime store and generating the additional dependencies file is accomplished using a [PowerShell](/powershell/scripting/overview) script.

For examples of how to set environment variables for various operating systems, see [Use multiple environments](xref:fundamentals/environments).
Expand Down Expand Up @@ -722,6 +725,9 @@ deployment/additionalDeps/shared/Microsoft.AspNetCore.App/2.1.0/StartupDiagnosti

For runtime to discover the runtime store location, the additional dependencies file location is added to the `DOTNET_ADDITIONAL_DEPS` environment variable.

> [!NOTE]
> The `DOTNET_ADDITIONAL_DEPS` environment variable only works with framework-dependent applications. This environment variable is ignored for self-contained applications.

In the sample app (*RuntimeStore* project), building the runtime store and generating the additional dependencies file is accomplished using a [PowerShell](/powershell/scripting/overview) script.

For examples of how to set environment variables for various operating systems, see [Use multiple environments](xref:fundamentals/environments).
Expand Down
8 changes: 8 additions & 0 deletions aspnetcore/fundamentals/openapi/customize-openapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ For example, the following operation transformer adds `500` as a response status

[!code-csharp[](~/fundamentals/openapi/samples/10.x/WebMinOpenApi/Program.cs?name=snippet_operationtransformer1)]

<!-- UPDATE 10.0 - API doc cross-link:
<xref:Microsoft.AspNetCore.Http.OpenApiRouteHandlerBuilderExtensions.AddOpenApiOperationTransformer%2A>
-->

Operation transformers can also be added to specific endpoint with the `AddOpenApiOperationTransformer` API, instead of all endpoints in a document. This can be useful to change specific OpenAPI data for a specific endpoint, like adding a security scheme, response description or other OpenAPI operation properties. The following example demonstrates adding an operation transformer to a deprecated endpoint specifically, which marks the endpoint as deprecated in the OpenAPI document.

[!code-csharp[](~/fundamentals/openapi/samples/10.x/WebMinOpenApi/Program.cs?name=snippet_operationtransformer2)]

## Use schema transformers

Schemas are the data models that are used in request and response bodies in an OpenAPI document. Schema transformers are useful when a modification:
Expand Down
Loading
Loading