runliuv

runliuv@cnblogs

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

LINQ to Entities does not recognize the method 'System.String ToString()' method, and this method cannot be translated into a store expression.

LinQ to entities 不能识别方法“system.string.ToString(system.String)”.因此该方法无法转换为存储表达式

 

 

allMch = dbContext.t_ApplyForWft.Where(x => x.OutMerchantId != null && x.MerchantId != null && x.pay_channel == PayChannel.FF.ToString())
                            .OrderBy(x => x.Id).Select(x => x.Id).ToList();

其中 PayChannel.FF 是enum 。

把“x.pay_channel == PayChannel.FF.ToString()” 改为 x.pay_channel == "FF"  就正常了。

 

posted on 2020-11-02 10:44  runliuv  阅读(780)  评论(0编辑  收藏  举报