【发布时间】:2019-11-05 02:56:52
【问题描述】:
我正在尝试将属性映射到公式以选择值,如果该列存在,则为默认值
我尝试了以下
mapper.Map(x => x.GroupId).Formula("(select case when exists (select * from INFORMATION_SCHEMA.COLUMNS SYS_COLS_TBL WHERE SYS_COLS_TBL.TABLE_NAME ='Azure' AND SYS_COLS_TBL.COLUMN_NAME = 'GroupId') then this_.GroupId else '' end)");
我收到一个错误 SqlException:列名“GroupId”无效。
【问题讨论】:
标签: nhibernate