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" 就正常了。