Skip to content

Commit

Permalink
Merge pull request #25 from sheng-jie/patch-2
Browse files Browse the repository at this point in the history
Update connection-strings.md
  • Loading branch information
LisandroSu authored Nov 27, 2018
2 parents 2c1331c + e84844b commit ec2e3da
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions entity-framework/core/miscellaneous/connection-strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ms.locfileid: "50191337"
---
# <a name="connection-strings"></a>连接字符串

大多数数据库提供程序需要某种形式的连接字符串以连接到数据库。 有时此连接字符串包含必须受到保护的敏感信息。 您可能还需要更改连接字符串,如环境,如开发、 测试和生产环境之间移动你的应用程序
大多数数据库提供程序需要某种形式的连接字符串以连接到数据库。有时此连接字符串包含必须受到保护的敏感信息。在开发、测试和生产环境等环境之间移动应用程序时,可能还需要更改连接字符串

## <a name="net-framework-applications"></a>.NET framework 应用程序

Expand Down Expand Up @@ -50,7 +50,7 @@ public class BloggingContext : DbContext

## <a name="universal-windows-platform-uwp"></a>通用 Windows 平台 (UWP)

中的 UWP 应用程序的连接字符串通常是 SQLite 连接,只需指定本地文件名。 它们通常不包含敏感信息,并且无需更改,因为应用程序已部署。 在这种情况下,这些连接字符串是保持在代码中,通常没问题,如下所示。 如果你想要使它们摆脱代码 UWP 支持的设置概念,请参阅[UWP 文档的应用设置部分](https://docs.microsoft.com/windows/uwp/app-settings/store-and-retrieve-app-data)有关详细信息
UWP 应用程序中的连接字符串通常是仅指定本地文件名的 SQLite 连接它们通常不包含敏感信息,并且无需更改,因为应用程序已部署。因此,这些连接字符串通常可保留在代码中,如下所示。如果要将它们移出代码并使 UWP 支持设置的概念,请参阅 [UWP 文档的应用设置部分](https://docs.microsoft.com/windows/uwp/app-settings/store-and-retrieve-app-data)了解详细信息

``` csharp
public class BloggingContext : DbContext
Expand All @@ -67,7 +67,7 @@ public class BloggingContext : DbContext

## <a name="aspnet-core"></a>ASP.NET Core

ASP.NET Core 配置系统是非常灵活,并在连接字符串可以存储在`appsettings.json`,环境变量、 用户密钥存储或另一个配置源。 请参阅[配置部分中的 ASP.NET Core 文档](https://docs.asp.net/en/latest/fundamentals/configuration.html)的更多详细信息。 下面的示例演示中存储的连接字符串`appsettings.json`
ASP.NET Core 中的配置系统非常灵活,并且连接字符串可以存储在 `appsettings.json`(一种环境变量)、用户机密存储或其他配置源中。请参阅 [ASP.NET Core文档的配置部分](https://docs.asp.net/en/latest/fundamentals/configuration.html)了解更多详细信息。下面的示例演示 `appsettings.json` 中存储的连接字符串

``` json
{
Expand Down

0 comments on commit ec2e3da

Please sign in to comment.