代码如下:

  

var query = from s in db.LoginUserServices
join ss in db.Services on s.ServiceType equals ss.Code into s_ss_join
from s_ss in s_ss_join.DefaultIfEmpty()
where s.LoginUserID.Equals(LoginUserID)
select new
{
// ServiceType = s.ServiceType,
ServiceName = s_ss.Name,
ServiceProperty = s_ss.Property,
ServiceCode = s.ServiceType
};

Linq to Array中报错:

报错位置:

Equals

改为:

var query = from s in db.LoginUserServices
join ss in db.Services on s.ServiceType equals ss.Code into s_ss_join
from s_ss in s_ss_join.DefaultIfEmpty()
where s.LoginUserID==LoginUserID
select new
{
// ServiceType = s.ServiceType,
ServiceName = s_ss.Name,
ServiceProperty = s_ss.Property,
ServiceCode = s.ServiceType
};

  

Unable to create a constant value of type 'System.Object'. Only primitive types or enumeration types are supported in this context.的更多相关文章

  1. Unable to create a constant value of type 'Closure type'

    使用Linq to Entities的时候发生如下异常: Unable to create a constant value of type 'Closure type'. Only primitiv ...

  2. The type 'System.Object' is defined in an assembly that is not referenced

    记录一个错误,报 The type 'System.Object' is defined in an assembly that is not referenced,[System.Runtime] ...

  3. [Hive - Tutorial] Type System 数据类型

    数据类型Type System Hive supports primitive and complex data types, as described below. See Hive Data Ty ...

  4. Unable to create the store directory. (Exception from HRESULT: 0x80131468)

    一个ASP.NET的程序,使用了MS ReportViewer报告控件,在用该控件导出生成Excel文件时,先是提示行不能超过65535. 这个是由于Excel2003的行限制的原因.由于修改成用Ex ...

  5. JVM虚拟机宕机_java.lang.OutOfMemoryError: unable to create new native thread

    原因:当前用户的系统最最大程序数数已达到最大值,使用ulimit -u可以看到是1024   解决办法:在当前用户下使用ulimit -u 65535 然后再执行jsp,一切ok     功能说明:控 ...

  6. Fatal error in launcher Unable to create process using 'dapppythonpython37python

    Fatal error in launcher: Unable to create process using '"d:\app\python\python37\python.exe&quo ...

  7. 记一次tomcat线程创建异常调优:unable to create new native thread

    测试在进行一次性能测试的时候发现并发300个请求时出现了下面的异常: HTTP Status 500 - Handler processing failed; nested exception is ...

  8. 解决Unable to create new native thread

    两种类型的Out of Memory java.lang.OutOfMemoryError: Java heap space error 当JVM尝试在堆中分配对象,堆中空间不足时抛出.一般通过设定J ...

  9. ArcEngine编辑保存错误:Unable to create logfile system tables

    通过ArcEngine对多个SDE中多个图层进行批量编辑处理,其中有部分图层在结束编辑的时候出现错误提示(部分图层可以,只有两个数据较多的图层保存失败). 错误信息:Unable to create ...

随机推荐

  1. storm(3)-本机模式-helloworld

    pom.xml <dependency> <groupId>org.apache.storm</groupId> <artifactId>storm-c ...

  2. 2016424王启元 Exp3免杀原理与实现

    基础问题回答 1.杀软是如何检测出恶意代码的? (1)基于特征码的检测 特征码是能识别一个程序是一个病毒的一段不大于64字节的特征串.如果一个可执行文件包含这样的特征码则被杀毒软件检测为是恶意代码. ...

  3. (转)MySQL 日志组提交

    原文:https://jin-yang.github.io/post/mysql-group-commit.html 组提交 (group commit) 是为了优化写日志时的刷磁盘问题,从最初只支持 ...

  4. 使用java配置来构建spring项目

    java配置是Spring4.x推荐的配置方式,可以完全代替xml配置,java配置是通过@Configuration和@Bean来实现的.@Configuration声明当前类是一个配置类,相当于S ...

  5. n皇后问题(分析)

    这道题需要用到回溯算法,现在在这里先简单的介绍一下这个算法: 回溯算法也叫试探法,它是一种系统地搜索问题的解的方法.回溯算法的基本思想是:从一条路往前走,能进则进,不能进则退回来,换一条路再试.用回溯 ...

  6. github不能访问,可能原因是host里有太多过期的对应

    github好久不能访问 一直以为是墙的原因 今天发现原来是有很多过期的host造成的 删掉那些host好了

  7. Jmeter测试计划中的元素

    测试计划中的元素(elements of a test plan) 本节描述测试计划不同的部分. 最小测试将包括测试计划.线程组和一个或多个采样器. 1 测试计划(Test Plan) 测试计划对象有 ...

  8. 九度oj 1464 Hello World for U 2012年浙江大学计算机及软件工程研究生机试真题

    题目1464:Hello World for U 时间限制:1 秒 内存限制:128 兆 特殊判题:否 提交:3872 解决:1082 题目描述: Given any string of N (> ...

  9. Python对列表中字典元素排序

    问题起源 json对象a,b a = '{"ROAD": [{"id": 123}, {"name": "no1"}]} ...

  10. jQuery 的动画效果图片----隐藏打开方法

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...