分享到: 百度 更多

Unable to create a constant value of type 'System.Object'. Only primitive types or enumeration types are supported in this context

把Equals改成 ==的写法就可以了,

query = query.WhereIf(m => m.VendorId==search.VendorId, !string.IsNullOrEmpty(Convert.ToString(search.VendorId)));
posted @ 2016-07-19 15:20  黑马_Summer  阅读(1012)  评论(0编辑  收藏  举报
分享到: 百度 更多