Unable to create a constant value of type 'System.Object'. Only primitive types or enumeration types are supported in this context.
代码如下:
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.的更多相关文章
- 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 ...
- 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] ...
- [Hive - Tutorial] Type System 数据类型
数据类型Type System Hive supports primitive and complex data types, as described below. See Hive Data Ty ...
- Unable to create the store directory. (Exception from HRESULT: 0x80131468)
一个ASP.NET的程序,使用了MS ReportViewer报告控件,在用该控件导出生成Excel文件时,先是提示行不能超过65535. 这个是由于Excel2003的行限制的原因.由于修改成用Ex ...
- JVM虚拟机宕机_java.lang.OutOfMemoryError: unable to create new native thread
原因:当前用户的系统最最大程序数数已达到最大值,使用ulimit -u可以看到是1024 解决办法:在当前用户下使用ulimit -u 65535 然后再执行jsp,一切ok 功能说明:控 ...
- 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 ...
- 记一次tomcat线程创建异常调优:unable to create new native thread
测试在进行一次性能测试的时候发现并发300个请求时出现了下面的异常: HTTP Status 500 - Handler processing failed; nested exception is ...
- 解决Unable to create new native thread
两种类型的Out of Memory java.lang.OutOfMemoryError: Java heap space error 当JVM尝试在堆中分配对象,堆中空间不足时抛出.一般通过设定J ...
- ArcEngine编辑保存错误:Unable to create logfile system tables
通过ArcEngine对多个SDE中多个图层进行批量编辑处理,其中有部分图层在结束编辑的时候出现错误提示(部分图层可以,只有两个数据较多的图层保存失败). 错误信息:Unable to create ...
随机推荐
- Mac os x的发展
OS X(前称Mac OS X)是苹果公司为麦金塔电脑开发的专属操作系统.Mac OS X于1998年首次推出,并从2002年起随麦金塔电脑发售.它是一套Unix基础的操作系统,包含两个主要的部分:核 ...
- 关于浏览器localhost点击wamp项目跳转出错
www目录下index.php399行代码 $handle=opendir("."); $projectContents = ''; while (($file = readdir ...
- zookeeper伪分布集群配置
1.上传tar文件zookeeper-3.4.12.tar.gz 2.解压zookeeper-3.4.12.tar.gz [root@localhost zookeeper]# .tar.gz 3.重 ...
- springboot 接口返回数据时 net.sf.json.JSONNull["empty"]) 异常
@ResetController返回数据时出现异常 Could not write JSON: Object is null; nested exception is com.fasterxml.ja ...
- js中报错"Maximum call stack size exceeded"解决方法
Uncaught RangeError: Maximum call stack size exceeded 错误直译过来就是“栈溢出”,出现这个错误的原因是因为我进行了递归运算,但是忘记添加判断条件, ...
- mysql 导入 excel 数据
客户准备了一些数据存放在 excel 中, 让我们导入到 mysql 中.先上来我自己把数据拷贝到了 txt 文件中, 自己解析 txt 文件,用 JDBC 循环插入到数据库中. 后来发现有更简单 ...
- org.dbunit.dataset.NoSuchTableException: t_group
遇到这个错误发现异常信息里有一项是这个 15:30:10,609 ERROR SchemaUpdate:236 - HHH000388: Unsuccessful: create table t_gr ...
- 关于发布webservice提示The test form is only available for requests from the local machine
通过编辑 Web 服务所在的 vroot 的 Web.config 文件,可以启用 HTTP GET 和 HTTP POST.以下配置同时启用了 HTTP GET 和 HTTP POST: <c ...
- jQuery 小练习-拖拉画面
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- yum -y update 报错:GPG key retrieval failed: [Errno 14] Could not open/read file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
用的是centos6.5的镜像,yum源太老了,修改了之后想更新一下: yum -y update 执行报错: warning: rpmts_HdrFromFdno: Header V3 RSA/SH ...