System.NotSupportedException: LINQ to Entities 不识别方法“System.Decimal ToDecimal(Int32)”,因此该方法无法转换为存储表达
来源:互联网 发布:淘宝的流量是什么意思 编辑:程序博客网 时间:2024/05/05 22:49
var sectionBasin = (from s in section
join b in standard
on s.SectionCode equals b.SectionCode
select new
{
SectionCode = s.SectionCode,
Province = s.Province,
Standard = b.Standard
}) .GroupBy(x => x.Province).Select(t => new
{
code = t.Key,
upStd = t.Where(x => x.Standard == 0).Count(),
subStd = t.Where(x => x.Standard == 1).Count(),
upsub=t.Count(),
rate = Convert.ToDecimal(t.Where(x => x.Standard == 0).Count()) / Convert.ToDecimal(t.Count())
join b in standard
on s.SectionCode equals b.SectionCode
select new
{
SectionCode = s.SectionCode,
Province = s.Province,
Standard = b.Standard
}) .GroupBy(x => x.Province).Select(t => new
{
code = t.Key,
upStd = t.Where(x => x.Standard == 0).Count(),
subStd = t.Where(x => x.Standard == 1).Count(),
upsub=t.Count(),
rate = Convert.ToDecimal(t.Where(x => x.Standard == 0).Count()) / Convert.ToDecimal(t.Count())
});
报错:
System.NotSupportedException: LINQ to Entities 不识别方法“System.Decimal ToDecimal(Int32)”,因此该方法无法转换为存储表达
改成先List,再GroupBy
}).ToList() .GroupBy(x => x.Province).Select(t => new
0 0
- System.NotSupportedException: LINQ to Entities 不识别方法“System.Decimal ToDecimal(Int32)”,因此该方法无法转换为存储表达
- LINQ to Entities 不识别方法“Int32 ToInt32(System.String)”,因此该方法无法转换为存储表达式
- LINQ to Entities 不识别方法“System.Guid Parse(System.String)”,因此该方法无法转换为存储表达式。
- LINQ to Entities 不识别方法"System.String ToString()",因此该方法无法转换为存储表达式 的解决方法
- LINQ to Entities 不识别方法“System.String ToString()”,因此该方法无法转换为存储表达式。
- LINQ to Entities 不识别方法“System.DateTime AddDays(Double)”,因此该方法无法转换为存储表达式。
- LINQ to Entities 不识别方法“System.String ToString()”,因此该方法无法转换为存储表达式。
- “LINQ to Entities 不识别方法"System.String ToString()",因此该方法无法转换为存储表达式。”
- 【福分系统】 LINQ to Entities 不识别方法“System.DateTime ToDateTime(System.String)”,因此该方法无法转换为存储表达式。
- LINQ to Entities 不识别方法“XXXXX”,因此该方法无法转换为存储表达式。
- 赶[LINQ to Entities] 的时髦:LINQ to Entities 不识别方法,因此该方法无法转换为存储表达式。
- LINQ to Entity 不识别方法“System.String ToString()”,因此该方法无法转换为存储表达式。
- LINQ to Entities 不识别方法“Int32 ToInt32(System.String)
- LINQ to Entities 不识别方法“Int32 ToInt32(System.String) 或 “Int32 Parse(System.String)”
- LINQ to Entities 不识别方法 xxx,此该方法无法转换为存储表达式
- EF 错误LINQ to Entities 不识别方法“Int32 ToInt32(System.String)
- LINQ to Entities 不识别方法"System.String ToString()"
- LINQ to Entities 不识别方法system.string
- 使用Java反射跟简单工厂模式改进抽象工厂模式
- c/c++ 获取时间, 精确到毫秒
- Caffe-python interface 学习|网络训练、部署、测试
- 配置新电脑
- eclipse 设置字体大小
- System.NotSupportedException: LINQ to Entities 不识别方法“System.Decimal ToDecimal(Int32)”,因此该方法无法转换为存储表达
- WIN8.1的安装和打开"这台电脑"速度很慢的解决办法
- keil .sct的理解
- android studio 问题(持续更新)
- Myeclipse中web项目部署以后jsp的java文件找不到问题(Tomcat配置serverlocations)
- 常用矩阵名词解释
- Android demo-->百度地图sdk,AS版本(一)导入地图
- JS判断移动端、pc端、安卓、苹果浏览器等方法整理
- tar.gz