• LINQ to Entities 不识别方法“System.String ToString()”,因此该方法无法转换为存储表达式。


    var queryBrand = from brand in dbContext.BrandTranOrderTBs
                                     from orderPayment in dbContext.OrderPaymentTBs
                                     where brand.ID.ToString()  == orderPayment.OrderIDs
                                     && orderPayment.Type==(int)OrderPaymentType.Brand
                                     && orderPayment.MemberID == memberIDOfBuyer
                                     && brand.Name.Contains(keywords)
                                     select new TranOrderView { 
                                         ID=brand.ID,
                                         Name=brand.Name,
                                         OrderPaymentNo=orderPayment.OrderPaymentNo,
                                         Price=brand.Price,
                                         TranOrderStatus=brand.Status,
                                         Type = (int)TranOrderType.Brand
                                     };
    出错代码
                    var queryBrand = from brand in dbContext.BrandTranOrderTBs.ToList()
                                     from orderPayment in dbContext.OrderPaymentTBs
                                     where brand.ID.ToString()  == orderPayment.OrderIDs
                                     && orderPayment.Type==(int)OrderPaymentType.Brand
                                     && orderPayment.MemberID == memberIDOfBuyer
                                     && brand.Name.Contains(keywords)
                                     select new TranOrderView { 
                                         ID=brand.ID,
                                         Name=brand.Name,
                                         OrderPaymentNo=orderPayment.OrderPaymentNo,
                                         Price=brand.Price,
                                         TranOrderStatus=brand.Status,
                                         Type = (int)TranOrderType.Brand
                                     };
    修正后
  • 相关阅读:
    RHEL 6.5 安装Docker
    sar命令
    Linux 安装部署 Redis
    hugepage设置
    pycharm使用
    oracle如何保证数据一致性和避免脏读
    转:数据库实例自动crash并报ORA-27157、ORA-27300等错误
    oracle安装内核参数设置
    外部表
    LNMP环境搭建
  • 原文地址:https://www.cnblogs.com/liandy0906/p/7994282.html
Copyright © 2020-2023  润新知