anjoy8 / Blog.Core

💖 ASP.NET Core 8.0 全家桶教程,前后端分离后端接口,vue教程姊妹篇,官方文档:
http://apk.neters.club/.doc
Apache License 2.0
5k stars 1.37k forks source link

✨ 优化操作多库 #301

Closed LemonNoCry closed 1 year ago

Jamnine commented 1 year ago

image 681276d01c698e96b04cdcc9e808f23 测试结果:还需要修改处理下SqlsugarSetup中的ConfigId,存储的时候ConfigId = m.ConnId.ObjToString().ToLower(),做了小写处理,根据属性自动切换库需要大小写对应

LemonNoCry commented 1 year ago

是根据实体特性[TenantAttribute("xxxx")]自动切换的

Jamnine commented 1 year ago

对,是根据[TenantAttribute("xxxx")],但是一般appsetting设置的和[TenantAttribute("xxxx")]是同样的,为了防止不一样,以前读取了ConfigId,统一tolower处理,现在的仓储没tolower,但是sqlsugar注入的时候tolower了,就会引起不一致找不到报错

LemonNoCry commented 1 year ago

好的 那我统一处理小写 之前想着在特性定义,自己只要定义跟配置文件一样就好了

Jamnine commented 1 year ago

image 嗯,去掉tolower,或者统一小写就ok了