Skip to content

Push live #32203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Nov 4, 2022
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
34 changes: 34 additions & 0 deletions .github/workflows/quest-bulk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "bulk quest import"
on:
workflow_dispatch:
inputs:
reason:
description: "The reason for running the bulk import workflow"
required: true
default: "Initial import into Quest (Azure DevOps)"

jobs:
bulk-import:
runs-on: ubuntu-latest
permissions:
contents: write
issues: write

steps:
- name: "Print manual bulk import run reason"
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
echo "Reason: ${{ github.event.inputs.reason }}"

- name: bulk-sequester
if: ${{ github.event_name == 'workflow_dispatch' }}
id: bulk-sequester
uses: dotnet/docs-tools/actions/sequester@main
env:
ImportOptions__ApiKeys__GitHubToken: ${{ secrets.GITHUB_TOKEN }}
ImportOptions__ApiKeys__OSPOKey: ${{ secrets.OSPO_KEY }}
ImportOptions__ApiKeys__QuestKey: ${{ secrets.QUEST_KEY }}
with:
org: ${{ github.repository_owner }}
repo: ${{ github.repository }}
issue: '-1'
13 changes: 9 additions & 4 deletions .github/workflows/quest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "quest import"
on:
issues:
types:
[ labeled ]
[ labeled, closed, reopened, assigned, unassigned ]
workflow_dispatch:
inputs:
reason:
Expand All @@ -15,7 +15,12 @@ on:

jobs:
import:
if: github.event.label.name == join(fromJson('[":", "world_map", ":", " reQUEST"]'), '') || github.event_name == 'workflow_dispatch'
if: |
github.event_name == 'workflow_dispatch' ||
github.event.label.name == ':world_map: reQUEST' ||
github.event.label.name == ':pushpin: seQUESTered' ||
contains(github.event.issue.labels.*.name, ':world_map: reQUEST') ||
contains(github.event.issue.labels.*.name, ':pushpin: seQUESTered')
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -32,7 +37,7 @@ jobs:
- name: manual-sequester
if: ${{ github.event_name == 'workflow_dispatch' }}
id: manual-sequester
uses: BillWagner/Quest2GitHub@main
uses: dotnet/docs-tools/actions/sequester@main
env:
ImportOptions__ApiKeys__GitHubToken: ${{ secrets.GITHUB_TOKEN }}
ImportOptions__ApiKeys__OSPOKey: ${{ secrets.OSPO_KEY }}
Expand All @@ -46,7 +51,7 @@ jobs:
- name: auto-sequester
if: ${{ github.event_name != 'workflow_dispatch' }}
id: auto-sequester
uses: BillWagner/Quest2GitHub@main
uses: dotnet/docs-tools/actions/sequester@main
env:
ImportOptions__ApiKeys__GitHubToken: ${{ secrets.GITHUB_TOKEN }}
ImportOptions__ApiKeys__OSPOKey: ${{ secrets.OSPO_KEY }}
Expand Down
1 change: 1 addition & 0 deletions docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@
"docs/core/whats-new/**/**.md": "adegeo",
"docs/csharp/**/*.*": "billwagner",
"docs/framework/**/**.md": "gewarren",
"docs/framework/additional-apis/pos-for-net/**/**.md": "TerryWarwick",
"docs/framework/app-domains/**/**.md": "gewarren",
"docs/framework/configure-apps/file-schema/network/**/**.md": "karelz",
"docs/framework/configure-apps/file-schema/wcf/**/**.md": "HongGit",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ The following table describes the infrastructure services provided by each block
| [Bindings](bindings.md) | Trigger code from events raised by external resources with bi-directional communication. |
| [Observability](observability.md) | Monitor and measure message calls across networked services. |
| [Secrets](secrets-management.md) | Securely access external secret stores. |
| Actors | Encapsulate logic and data in reusable actor objects. |
| [Actors](actors.md) | Encapsulate logic and data in reusable actor objects. |

Building blocks abstract the implementation of distributed application capabilities from your services. Figure 2-3 shows this interaction.

Expand Down
12 changes: 4 additions & 8 deletions docs/architecture/maui/accessing-remote-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ public async Task<TResult> GetAsync<TResult>(string uri, string token = "")
HttpResponseMessage response = await httpClient.GetAsync(uri);

await HandleResponse(response);
string serialized = await response.Content.ReadAsStringAsync();

TResult result = JsonConvert.DeserializeObject<TResult>(serialized, _serializerSettings);
TResult result = await response.Content.ReadFromJsonAsync<TResult>();

return result;
}
Expand Down Expand Up @@ -202,15 +200,13 @@ public async Task<TResult> PostAsync<TResult>(
{
HttpClient httpClient = GetOrCreateHttpClient(token);

var content = new StringContent(JsonConvert.SerializeObject(data));
var content = new StringContent(JsonSerializer.Serialize(data));
content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
HttpResponseMessage response = await httpClient.PostAsync(uri, content);

await HandleResponse(response);
string serialized = await response.Content.ReadAsStringAsync();

TResult result = JsonConvert.DeserializeObject<TResult>(serialized, _serializerSettings);

TResult result = await response.Content.ReadFromJsonAsync<TResult>();

return result;
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/maui/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,6 @@ The eShopOnContainers project contains the following folders:

## Summary

Microsoft's cross-platform multi-platform app development tools and platforms provide a comprehensive solution for B2E, B2B, and B2C mobile client apps, providing the ability to share code across all target platforms (iOS, Android, and Windows) and helping to lower the total cost of ownership. Apps can share their user interface and app logic code, while retaining the native platform look and feel.
Microsoft's cross-platform multi-platform app development tools and platforms provide a comprehensive solution for B2E, B2B, and B2C mobile client apps, providing the ability to share code across all target platforms (iOS, macOS, Android, and Windows) and helping to lower the total cost of ownership. Apps can share their user interface and app logic code, while retaining the native platform look and feel.

Developers of enterprise apps face several challenges that can alter the architecture of the app during development. Therefore, it's important to build an app so that it can be modified or extended over time. Designing for such adaptability can be difficult, but typically involves partitioning an app into discrete, loosely coupled components that can be easily integrated together into an app.
4 changes: 2 additions & 2 deletions docs/architecture/maui/mvvm.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The benefits of using the MVVM pattern are as follows:

- If an existing model implementation encapsulates existing business logic, it can be difficult or risky to change it. In this scenario, the view model acts as an adapter for the model classes and prevents you from making major changes to the model code.
- Developers can create unit tests for the view model and the model, without using the view. The unit tests for the view model can exercise exactly the same functionality as used by the view.
- The app UI can be redesigned without touching the code, provided that the view is implemented entirely in XAML. Therefore, a new version of the view should work with the existing view model.
- The app UI can be redesigned without touching the view model and model code, provided that the view is implemented entirely in XAML or C#. Therefore, a new version of the view should work with the existing view model.
- Designers and developers can work independently and concurrently on their components during development. Designers can focus on the view, while developers can work on the view model and model components.

The key to using MVVM effectively lies in understanding how to factor app code into the correct classes and how the classes interact. The following sections discuss the responsibilities of each of the classes in the MVVM pattern.
Expand All @@ -35,7 +35,7 @@ The key to using MVVM effectively lies in understanding how to factor app code i

The view is responsible for defining the structure, layout, and appearance of what the user sees on screen. Ideally, each view is defined in XAML, with a limited code-behind that does not contain business logic. However, in some cases, the code-behind might contain UI logic that implements visual behavior that is difficult to express in XAML, such as animations.

In a .NET MAUI application, a view is typically a `Page`-derived or `ContentView`-derived class. However, views can also be represented by a data template, which specifies the UI elements to be used to visually represent an object when it's displayed. A data template as a view does not have any code-behind, and is designed to bind to a specific view model type.
In a .NET MAUI application, a view is typically a `ContentPage`-derived or `ContentView`-derived class. However, views can also be represented by a data template, which specifies the UI elements to be used to visually represent an object when it's displayed. A data template as a view does not have any code-behind, and is designed to bind to a specific view model type.

> [!TIP]
> Avoid enabling and disabling UI elements in the code-behind.
Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/maui/preface.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ms.date: 06/18/2022

[!INCLUDE [download-alert](includes/download-alert.md)]

This eBook provides guidance on building cross-platform enterprise apps using .NET MAUI. .NET MAUI is a cross-platform UI toolkit that allows developers to easily create native user interface layouts that can be shared across platforms, including iOS, macOS Android, and Windows 10/11. It provides a comprehensive solution for Business to Employee (B2E), Business to Business (B2B), and Business to Consumer (B2C) apps, providing the ability to share code across all target platforms and helping to lower the total cost of ownership (TCO).
This eBook provides guidance on building cross-platform enterprise apps using .NET MAUI. .NET MAUI is a cross-platform UI toolkit that allows developers to easily create native user interface layouts that can be shared across platforms, including iOS, macOS, Android, and Windows 10/11. It provides a comprehensive solution for Business to Employee (B2E), Business to Business (B2B), and Business to Consumer (B2C) apps, providing the ability to share code across all target platforms and helping to lower the total cost of ownership (TCO).

The guide provides architectural guidance for developing adaptable, maintainable, and testable .NET MAUI enterprise apps. Guidance is provided on how to implement MVVM, dependency injection, navigation, validation, and configuration management, while maintaining loose coupling. In addition, there's also guidance on performing authentication and authorization with IdentityServer, accessing data from containerized microservices, and unit testing.

Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/maui/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ms.date: 07/09/2022

Any app that accepts input from users should ensure that the input is valid. An app could, for example, check for input that contains only characters in a particular range, is of a certain length, or matches a particular format. Without validation, a user can supply data that causes the app to fail. Proper validation enforces business rules and could help to prevent an attacker from injecting malicious data.

In the context of the Model-ViewModel-Model (MVVM) pattern, a view model or model will often be required to perform data validation and signal any validation errors to the view so that the user can correct them. The eShopOnContainers multi-platform app performs synchronous client-side validation of view model properties and notifies the user of any validation errors by highlighting the control that contains the invalid data, and by displaying error messages that inform the user of why the data is invalid. The image below shows the classes involved in performing validation in the eShopOnContainers multi-platform app.
In the context of the Model-View-ViewModel (MVVM) pattern, a view model or model will often be required to perform data validation and signal any validation errors to the view so that the user can correct them. The eShopOnContainers multi-platform app performs synchronous client-side validation of view model properties and notifies the user of any validation errors by highlighting the control that contains the invalid data, and by displaying error messages that inform the user of why the data is invalid. The image below shows the classes involved in performing validation in the eShopOnContainers multi-platform app.

![Validation classes in the eShopOnContainers multi-platform app.](./media/validation-workflow.png)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ There are several ways that you can use `IHttpClientFactory` in your application

For the sake of brevity, this guidance shows the most structured way to use `IHttpClientFactory`, which is to use Typed Clients (Service Agent pattern). However, all options are documented and are currently listed in this [article covering the `IHttpClientFactory` usage](/aspnet/core/fundamentals/http-requests#consumption-patterns).

> [!NOTE]
> If your app requires cookies, it might be better to avoid using <xref:System.Net.Http.IHttpClientFactory> in your app. For alternative ways of managing clients, see [Guidelines for using HTTP clients](../../../fundamentals/networking/http/httpclient-guidelines.md)

## How to use Typed Clients with IHttpClientFactory

So, what's a "Typed Client"? It's just an `HttpClient` that's pre-configured for some specific use. This configuration can include specific values such as the base server, HTTP headers or time outs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ await _context.SaveChangesAsync();

EF Core supports both synchronous and async methods for fetching and saving. In web applications, it's recommended to use the async/await pattern with the async methods, so that web server threads are not blocked while waiting for data access operations to complete.

For more information, see [Buffering and Streaming](/ef/core/performance/efficient-querying#buffering-and-streaming).

### Fetching related data

When EF Core retrieves entities, it populates all of the properties that are stored directly with that entity in the database. Navigation properties, such as lists of related entities, are not populated and may have their value set to null. This process ensures EF Core is not fetching more data than is needed, which is especially important for web applications, which must quickly process requests and return responses in an efficient manner. To include relationships with an entity using _eager loading_, you specify the property using the Include extension method on the query, as shown:
Expand Down Expand Up @@ -159,18 +161,17 @@ public class Basket : BaseEntity

public void AddItem(int catalogItemId, decimal unitPrice, int quantity = 1)
{
if (!Items.Any(i => i.CatalogItemId == catalogItemId))
var existingItem = Items.FirstOrDefault(i => i.CatalogItemId == catalogItemId);
if (existingItem == null)
{
_items.Add(new BasketItem()
{
CatalogItemId = catalogItemId,
Quantity = quantity,
UnitPrice = unitPrice
});
return;
}
var existingItem = Items.FirstOrDefault(i => i.CatalogItemId == catalogItemId);
existingItem.Quantity += quantity;
}
else existingItem.Quantity += quantity;
}
}
```
Expand Down
4 changes: 4 additions & 0 deletions docs/breadcrumb/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ items:
- name: Additional APIs
tocHref: /dotnet/framework/additional-apis/
topicHref: /dotnet/framework/additional-apis/index
items:
- name: Point of Service for .NET
tocHref: /dotnet/framework/additional-apis/pos-for-net/
topicHref: /dotnet/framework/additional-apis/pos-for-net/index
- name: Application domains and assemblies
tocHref: /dotnet/framework/app-domains/
topicHref: /dotnet/framework/app-domains/index
Expand Down
2 changes: 2 additions & 0 deletions docs/core/compatibility/7.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ If you're migrating an app to .NET 7, the breaking changes listed here might aff
| [Collectible Assembly in non-collectible AssemblyLoadContext](core-libraries/7.0/collectible-assemblies.md) | ❌ | ✔️ | Preview 5 |
| [Equals method behavior change for NaN](core-libraries/7.0/equals-nan.md) | ❌ | ✔️ | Preview 5 |
| [Generic type constraint on PatternContext\<T>](core-libraries/7.0/patterncontext-generic-constraint.md) | ❌ | ❌ | Preview 3 |
| [Legacy FileStream strategy removed](core-libraries/7.0/filestream-compat-switch.md) | ❌ | ✔️ | Preview 1 |
| [Library support for older frameworks](core-libraries/7.0/old-framework-support.md) | ❌ | ❌ | Preview 1 |
| [Maximum precision for numeric format strings](core-libraries/7.0/max-precision-numeric-format-strings.md) | ❌ | ✔️ | RC 1 |
| [SerializationFormat.Binary is obsolete](core-libraries/7.0/serializationformat-binary.md) | ❌ | ❌ | Preview 2 |
| [Time fields on symbolic links](core-libraries/7.0/symbolic-link-timestamps.md) | ❌ | ✔️ | Preview 1 |
| [Tracking linked cache entries](core-libraries/7.0/memorycache-tracking.md) | ❌ | ✔️ | Preview 1 |
| [Validate CompressionLevel for BrotliStream](core-libraries/7.0/compressionlevel-validation.md) | ❌ | ✔️ | Preview 1 |

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: ".NET 6 breaking change: FileStream doesn't synchronize file offset with OS"
description: Learn about the .NET 6 breaking change in core .NET libraries where FileStream doesn't synchronize the file offset with the operating system.
ms.date: 05/05/2021
ms.date: 10/04/2022
---
# FileStream no longer synchronizes file offset with OS

Expand Down Expand Up @@ -65,6 +65,9 @@ With this change, <xref:System.IO.FileStream.ReadAsync%2A> operations are up to
set DOTNET_SYSTEM_IO_USENET5COMPATFILESTREAM=1
```

> [!NOTE]
> This switch is only available in .NET 6. It was [removed in .NET 7](../7.0/filestream-compat-switch.md).

## Affected APIs

None.
Expand All @@ -73,15 +76,3 @@ None.

- [SetFilePointer function](/windows/win32/api/fileapi/nf-fileapi-setfilepointer)
- [SetFilePointerEx function](/windows/win32/api/fileapi/nf-fileapi-setfilepointerex)

<!--

### Category

- Core .NET libraries

### Affected APIs

Not detectible via API analysis.

-->
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: ".NET 6 breaking change: FileStream.Position updated after ReadAsync or WriteAsync completion"
description: Learn about the .NET 6 breaking change in core .NET libraries where FileStream.Position is updated after ReadAsync or WriteAsync completion.
ms.date: 05/05/2021
ms.date: 10/04/2022
---
# FileStream.Position updates after ReadAsync or WriteAsync completes

Expand Down Expand Up @@ -68,18 +68,9 @@ Now, when buffering is enabled (that is, the `bufferSize` argument that's passed
set DOTNET_SYSTEM_IO_USENET5COMPATFILESTREAM=1
```

> [!NOTE]
> This switch is only available in .NET 6. It was [removed in .NET 7](../7.0/filestream-compat-switch.md).

## Affected APIs

- <xref:System.IO.FileStream.Position?displayProperty=fullName>

<!--

### Category

- Core .NET libraries

### Affected APIs

- `P:System.IO.FileStream.Position`

-->
Loading