代码如下:

  

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. netty总结

    eventLoopGroup中创建各个eventLoop处理线程,各个pipeLineHandler处理childEvent时是在自己的线程中, 全异步

  2. hive Data Types

    在文章最开始,就先强调一下,hive不是仅仅支持string类型,hive不是仅仅支持string类型,hive不是仅仅支持string类型. Numeric Types tinyint,-128到1 ...

  3. vue2.0修饰符sync用法

    如果子组件是一个弹窗,我们想通过点击关闭按钮来关闭子组件弹窗,子组件弹窗的v-show由变量isVisible控制,这个变量通过props由父组件来注入, 而子组件无法改变props里面的变量的值,但 ...

  4. condition实现原理

    condition是对线程进行控制管理的接口,具体实现是AQS的一个内部类ConditionObject,主要功能是控制线程的启/停(这么说并不严格,还要有锁的竞争排队). condition主要方法 ...

  5. Ubuntu 下常用的命令 简略记录

    # 动态显示 NVIDIA watch -n 1 nvidia-smi #查看某一目录下文件的总数(不包含子目录) ls -l | wc -l #挂载硬盘或者U盘 mount /dev/sdb1 /m ...

  6. 微信小程序-tab标签栏实现教程

    一.摘要 tab栏(标签切换栏)是app中常见的一种交互方式,它可以承载更多的内容,同时又兼顾友好体验的优点.但在小程序中,官方并没有为咱们提供现成的组件.因此我们程序员展现才艺的时候到了(其实市面上 ...

  7. Windows下SVN回滚到旧版本(TortoiseSVN)

    当发现新提交的代码有问题,然后想将某个旧的版本作为最新的版本时,可以使用回滚, 操作步骤如下: 1. 签出(CheckOut)最新版本的代码到电脑中(不能做任何修改) 2. 执行TortoiseSVN ...

  8. VS2008默认的字体居然是 新宋体

    本人还是觉得 C#就是要这样看着舒服

  9. ormLite注解小记

    注解是特殊的代码标志已在Java版本开始,要指定什么类和字段存储在数据库中,ORMLite支持其自己的注解(@ DatabaseTable @ DatabaseField)或更多的标准注解从javax ...

  10. [PY3]——根据某个特定的字段来分组迭代访问一个字段或序列?/ itertools.groupby( )函数

    问题 你有一个字典或者实例的序列,然后你想根据某个特定的字段(比如‘date’)来分组迭代访问. 解决方案 itertools.groupby( )函数 itertools.groupby(rows, ...