數據庫變動在編程應用中是常的,MySQL、Sql Service之間的數據遷移更爲常見,在 SqlRepoEx2.0DemoForAspCore 中演示了,這種數據庫之間切換時SqlRepoEx是如何的簡單。中演示了,這種數據庫之間切換時SqlRepoEx是如何的簡單。git
第一步、增長SqlRepoEx.MySql.ServiceCollection的Nuget引用;github
第二步、更改Startup.cs文件中數據庫
using SqlRepoEx.MsSql.ServiceCollection;編程
爲using SqlRepoEx.MySql.ServiceCollection;spa
第三步、更改ConnectionString 字串爲 string ConnectionString = "datasource=127.0.0.1;username=test;password=test;database=northwind;charset=gb2312;SslMode = none;";blog
而後,就沒了
get
爲演示代碼,我在MySql中增長了`customers` 個,其結構與數據與Northwind數據庫Customers表相同。源碼
源碼見:string