zoukankan      html  css  js  c++  java
  • LINQ to Entities 不识别方法“System.String get_Item(Int32)”,因此该方法无法转换为存储表达式。

    1、LINQ to Entities 不识别方法“System.String get_Item(Int32)”,因此该方法无法转换为存储表达式。项目中发现linq to entities 不识别? ,为何大家都要腰间盘,你的如此突出。

     Expression<Func<Models.GroupMemberModel, bool>> epression = ep => (ep.GroupId.Equals(gm.GroupId) && ep.MemberId.Equals(gm.members[i]));
     var model = dbcontext.groupmember.Where(epression);

    后来测试发现把具体的值直接带进去是可以的,折腾一番直接定义一个变量,问题解决了。

    string memberId = gm.members[i].ToString();
    Expression
    <Func<Models.GroupMemberModel, bool>> epression = ep => (ep.GroupId.Equals(gm.GroupId) && ep.MemberId.Equals(memberId)); var model = dbcontext.groupmember.Where(epression);
  • 相关阅读:
    结构型模式(一) 适配器模式
    选择器
    CSS引入
    CSS语法
    CSS介绍
    HTML练习
    HTML标签嵌套规则(重点)
    HTML标签分类(重点)
    HTML标签属性
    body标签
  • 原文地址:https://www.cnblogs.com/youmingkuang/p/9887431.html
Copyright © 2011-2022 走看看