[英]How to handle the DBNull with Expression in this case?
我使用以下代碼片段來進行一些比較
Expression.Constant(DBNull.Value, typeof (Int32));
執行這些行時,我得到以下異常
System.ArgumentException occurred
HResult=-2147024809
Message=Argument types do not match
Source=System.Core
StackTrace:
at System.Linq.Expressions.Expression.Constant(Object value, Type type)
InnerException:
傳遞System.Data.SqlTypes.SqlInt32.Null
而不是DBNull.Value
Expression.Constant(SqlInt32.Null, typeof (Int32));
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.