读取连接字符串,联合使用 appsettings.json
大石头 authored at 2018-06-23 10:46:55
757.00 B
X
{
  "exclude": [
    "**/bin",
    "**/bower_components",
    "**/jspm_packages",
    "**/node_modules",
    "**/obj",
    "**/platforms"
  ],
  "ConnectionStrings": {
    "SQLite": {
      "connectionString": "Data Source=test.db;",
      "providerName": "Sqlite"
    },
    "MySql": {
      "connectionString": "Server=.;Port=3306;Database=mysql;Uid=root;Pwd=;",
      "providerName": "MySql.Data.MySqlClient"
    },
    "MSSQL": {
      "connectionString": "Server=.;User ID=sa;Password=sa;Database=Test;datapath=~\\App_Data",
      "providerName": "System.Data.SqlClient"
    },
    "Oracle": {
      "connectionString": "Data Source=Tcp://127.0.0.1/ORC;User ID=sys;Password=admin;Owner=mis",
      "providerName": "System.Data.OracleClient"
    }
  }
}