輕量ORM-SqlRepoEx (八)MySQL、Sql Service 遷移

數據庫變動在編程應用中是常的,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

https://gitee.com/azthinker/SqlRepoEx2.0DemoForAspCoreit

https://github.com/AzThinker/SqlRepoEx2.0DemoForAspCore

相關文章
相關標籤/搜索