How can C# nullable value typed values be set on NHibernate named IQuery parameters?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using NHibernate and calling a stored procedure via a named query: <sql-query name="SearchStuff" read-only="true" cacheable="true"> <return class="ResultEntity" /> EXEC [SearchStuff] ?, ?, ? </sql-query> Many of the stored procedure parameters are deliberately nullable - this cannot be changed. The C#: IQuery listQuery = this.Session.GetNamedQuery("SearchStuff"); listQuery.SetInt32(0, param1); listQuery.SetDateTime(1, param2); listQuery.SetString(2, param3); IList<ResultEntity> results = listQuery.List<ResultEntity>(); Unfortunately,