轻量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

相关文章
相关标签/搜索