数据库变动在编程应用中是常的,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