DotNetNext / SqlSugar

.Net aot ORM Fastest ORM Simple Easy VB.NET Sqlite orm Oracle ORM Mysql Orm 虚谷数据库 postgresql ORm SqlServer oRm 达梦 ORM 人大金仓 ORM 神通ORM C# ORM , C# ORM .NET ORM NET5 ORM .NET6 ORM ClickHouse orm QuestDb ,TDengine ORM,OceanBase orm,GaussDB orm ,Tidb orm Object/Relational Mapping
https://www.donet5.com/Home/Doc
MIT License
5.35k stars 1.34k forks source link

查询字段里用到了数据库函数 #956

Closed overfreedom closed 3 years ago

overfreedom commented 3 years ago

数据库表的某个字段要经过函数转换才是其真实值 如select Sf_Translate(IdCard, IdType) IdCard from Employee 我尝试过用ConfigureExternalServices.EntityService修改了DbColumnName 然后在‘AopEvents.OnExecutingChangeSql’修改语句去掉引号,但是查询出来的实体的IdCard的值是null的。 有什么好的实现方法吗?

DotNetNext commented 3 years ago

IdCard =SqlFunc.MappingColumn(default(string), "Sf_Translate(IdCard, IdType)")