Skip to content

Update Live with current Master #6716

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 22 commits into from
Jul 29, 2018
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
6 changes: 3 additions & 3 deletions docs/csharp/language-reference/keywords/switch.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Starting with C# 7.0, the match expression can be any non-null expression.

## The switch section

A `switch` statement includes one or more switch sections. Each switch section contains one or more *case labels* followed by one or more statements. The following example shows a simple `switch` statement that has three switch sections. Each switch section has one case label, such as `case 1:`, and two statements.
A `switch` statement includes one or more switch sections. Each switch section contains one or more *case labels* (either a case or default label) followed by one or more statements. The `switch` statement may include at most one default label placed in any switch section. The following example shows a simple `switch` statement that has three switch sections, each containing two statements. The second switch section contains the `case 2:` and `case 3:` labels.

A `switch` statement can include any number of switch sections, and each section can have one or more case labels, as shown in the following example. However, no two case labels may contain the same expression.

Expand Down Expand Up @@ -170,9 +170,9 @@ Without pattern matching, this code might be written as follows. The use of type

## The `case` statement and the `when` clause

Starting with C# 7.0, because case statements need not be mutually exclusive, you can use add a `when` clause to specify an additional condition that must be satisfied for the case statement to evaluate to true. The `when` clause can be any expression that returns a Boolean value. One of the more common uses for the `when` clause is used to prevent a switch section from executing when the value of a match expression is `null`.
Starting with C# 7.0, because case statements need not be mutually exclusive, you can add a `when` clause to specify an additional condition that must be satisfied for the case statement to evaluate to true. The `when` clause can be any expression that returns a Boolean value. One of the more common uses for the `when` clause is used to prevent a switch section from executing when the value of a match expression is `null`.

The following example defines a base `Shape` class, a `Rectangle` class that derives from `Shape`, and a `Square` class that derives from `Rectangle`. It uses the `when` clause to ensure that the `ShowShapeInfo` treats a `Rectangle` object that has been assigned equal lengths and widths as a `Square` even if is has not been instantiated as a `Square` object. The method does not attempt to display information either about an object that is `null` or a shape whose area is zero.
The following example defines a base `Shape` class, a `Rectangle` class that derives from `Shape`, and a `Square` class that derives from `Rectangle`. It uses the `when` clause to ensure that the `ShowShapeInfo` treats a `Rectangle` object that has been assigned equal lengths and widths as a `Square` even if it has not been instantiated as a `Square` object. The method does not attempt to display information either about an object that is `null` or a shape whose area is zero.

[!code-csharp[switch#8](../../../../samples/snippets/csharp/language-reference/keywords/switch/when-clause.cs#1)]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Users can install and run multiple versions of the .NET Framework on their compu
|379893|.NET Framework 4.5.2|
|On Windows 10 systems only: 393295<br /><br /> On all other OS versions: 393297|[!INCLUDE[net_v46](../../../includes/net-v46-md.md)]|
|On Windows 10 November Update systems only: 394254<br /><br /> On all other OS versions: 394271|[!INCLUDE[net_v461](../../../includes/net-v461-md.md)]|
|On Windows 10 Anniversary Update only: 394802<br /><br /> On all other OS versions: 394806|[!INCLUDE[net_v462](../../../includes/net-v462-md.md)]|
|On Windows 10 Anniversary Update and Windows Server 2016: 394802<br /><br /> On all other OS versions: 394806|[!INCLUDE[net_v462](../../../includes/net-v462-md.md)]|
|On Windows 10 Creators Update only: 460798<br/><br/> On all other OS versions: 460805 | .NET Framework 4.7 |
|On Windows 10 Fall Creators Update only: 461308<br/><br/> On all other OS versions: 461310 | .NET Framework 4.7.1 |
|On Windows 10 April 2018 Update only: 461808<br/><br/> On all other OS versions: 461814| .NET Framework 4.7.2 |
Expand Down Expand Up @@ -136,7 +136,7 @@ Users can install and run multiple versions of the .NET Framework on their compu
|.NET Framework 4.6 installed on all other Windows OS versions|393297|
|.NET Framework 4.6.1 installed on Windows 10|394254|
|.NET Framework 4.6.1 installed on all other Windows OS versions|394271|
|.NET Framework 4.6.2 installed on Windows 10 Anniversary Update|394802|
|.NET Framework 4.6.2 installed on Windows 10 Anniversary Update and Windows Server 2016|394802|
|.NET Framework 4.6.2 installed on all other Windows OS versions|394806|
|.NET Framework 4.7 installed on Windows 10 Creators Update|460798|
|.NET Framework 4.7 installed on all other Windows OS versions|460805|
Expand Down
2 changes: 1 addition & 1 deletion docs/fsharp/language-reference/computation-expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ If the [async workflow](asynchronous-workflows.md), this type is `Async<unit>`.

### `yield`

The `yield` keyword is for returning a value from the computation expression so that it can be consumed as an <xref:system.collections.generic.ienumerable-1>:
The `yield` keyword is for returning a value from the computation expression so that it can be consumed as an <xref:System.Collections.Generic.IEnumerable%601>:

```fsharp
let squares =
Expand Down
2 changes: 1 addition & 1 deletion docs/fsharp/language-reference/value-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Not all performance-sensitive scenarios are "solved" by using structs. You must

## Definition

Value Option is defined as a [struct discriminated union](discriminated-unions.md#struct-discriminated-union) that is similar to the reference option type:
Value Option is defined as a [struct discriminated union](discriminated-unions.md#struct-discriminated-unions) that is similar to the reference option type:

```fsharp
[<StructuralEquality; StructuralComparison>]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ services:

Note that this docker-compose.yml file is a simplified and merged version. It contains static configuration data for each container (like the name of the custom image), which always applies, plus configuration information that might depend on the deployment environment, like the connection string. In later sections, you will learn how you can split the docker-compose.yml configuration into multiple docker-compose files and override values depending on the environment and execution type (debug or release).

The docker-compose.yml file example defines five services: the webmvc service (a web application), two microservices (catalog.api and ordering.api), and one data source container, sql.data, based on SQL Server for Linux running as a container. Each service is deployed as a container, so a Docker image is required for each.
The docker-compose.yml file example defines four services: the webmvc service (a web application), two microservices (catalog.api and ordering.api), and one data source container, sql.data, based on SQL Server for Linux running as a container. Each service is deployed as a container, so a Docker image is required for each.

The docker-compose.yml file specifies not only what containers are being used, but how they are individually configured. For instance, the webmvc container definition in the .yml file:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ This means you can complement your API with a nice discovery UI to help develope

The API explorer is not the most important thing here. Once you have a Web API that can describe itself in Swagger metadata, your API can be used seamlessly from Swagger-based tools, including client proxy-class code generators that can target many platforms. For example, as mentioned, [AutoRest](https://github.com/Azure/AutoRest) automatically generates .NET client classes. But additional tools like [swagger-codegen](https://github.com/swagger-api/swagger-codegen) are also available, which allow code generation of API client libraries, server stubs, and documentation automatically.

Currently, Swashbuckle consists of two several internal NuGet packages under the high-level meta- package [Swashbuckle.Swashbuckle.AspNetCoreSwaggerGen](https://www.nuget.org/packages/Swashbuckle.AspNetCore/) version 1.0.0 or later for ASP.NET Core applications.
Currently, Swashbuckle consists of several internal NuGet packages under the high-level meta-package [Swashbuckle.AspNetCore](https://www.nuget.org/packages/Swashbuckle.AspNetCore/) version 1.0.0 or later for ASP.NET Core applications.

After you have installed these NuGet packages in your Web API project, you need to configure Swagger in the Startup class, as in the following code:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Focusing on a single container, the catalog.api container-microservice has a str
catalog.api:
image: eshop/catalog.api
environment:
- ConnectionString=Server=catalog.data;Initial Catalog=CatalogData;User Id=sa;Password=your@password
- ConnectionString=Server=sql.data;Initial Catalog=CatalogData;User Id=sa;Password=your@password
expose:
- "80"
ports:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Serverless may be used to implement one or more layers.
* Services aren't dependent on a single data store.
* The system is designed with failure in mind, and the app may still run even when certain services fail.

Microservices don't have to be mutual to other architecture approaches. For example, an N-Tier architecture may use microservices for the middle tier. It's also possible to implement microservices in a variety of ways, from virtual directories on IIS hosts to containers. The characteristics of microservices make them especially ideal for serverless implementations.
Microservices don't have to be mutually exclusive to other architecture approaches. For example, an N-Tier architecture may use microservices for the middle tier. It's also possible to implement microservices in a variety of ways, from virtual directories on IIS hosts to containers. The characteristics of microservices make them especially ideal for serverless implementations.

![Microservices architecture](./media/microservices-architecture.png)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ For more information, see [Implementing the Circuit Breaker pattern](../microser

## Versioning and green/blue deployments

A major benefit of serverless is the ability to upgrade a specific function without having to redeploy the entire application. For upgrades to be successful, functions must be versioned so that services calling them are routed to the correct version of code. A strategy for deploying new versions is also important. A common approach is to use "green/blue deployments." The green deployment is the current function. A new "blue" version is deployed to production and tested. When testing passes, the green and blue versions are swapped so the new version comes live. If any issues are encountered, they can be swapped back. Supporting versioning and green/blue deployments requires a combination of authoring the functions to accommodate version changes and working with the serverless platform to handle deployments. One possible approach is to use proxies, which are described in the [./azure-functions.md](Azure serverless platform) chapter.
A major benefit of serverless is the ability to upgrade a specific function without having to redeploy the entire application. For upgrades to be successful, functions must be versioned so that services calling them are routed to the correct version of code. A strategy for deploying new versions is also important. A common approach is to use "green/blue deployments." The green deployment is the current function. A new "blue" version is deployed to production and tested. When testing passes, the green and blue versions are swapped so the new version comes live. If any issues are encountered, they can be swapped back. Supporting versioning and green/blue deployments requires a combination of authoring the functions to accommodate version changes and working with the serverless platform to handle deployments. One possible approach is to use proxies, which are described in the [Azure serverless platform](azure-functions.md#proxies) chapter.

>[!div class="step-by-step"]
[Previous](serverless-architecture.md)
[Next](serverless-design-examples.md)
[Next](serverless-design-examples.md)