出现这个错误提示可以用 DbFunctions.TruncateTime 将Linq中entity的DateTime转化一下再使用,如下所示:

var anyCalls = _db.CallLogs.Where(x => DbFunctions.TruncateTime(x.DateTime) == callDateTime.Date).ToList();

更多详细解答请看如下链接:

http://stackoverflow.com/questions/14601676/the-specified-type-member-date-is-not-supported-in-linq-to-entities-only-init

Date vs DateTime

http://stackoverflow.com/questions/798121/date-vs-datetime

The specified type member 'Date' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties的更多相关文章

  1. The specified type member 'Date' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported.

    使用EF时,在Limda表达式中( query.Where(x => x.CheckInDate >= bd.Date);)查询的时候抛出了这个异常,网上查到的发现,并不能解决问题. 后来 ...

  2. The specified type member 'IsLock' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported.

    var query = from C in objDb.GetDb<A>() join a in objDb.GetDb<B>().Where(m => m.Comput ...

  3. 记录一个EF连接查询的异常:the entity or complex type 'x' cannot be constructed in a linq to entities query

    问题解决连接:https://stackoverflow.com/questions/5325797/the-entity-cannot-be-constructed-in-a-linq-to-ent ...

  4. #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)

    #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)宏的运行机理:1. ( (TYPE *)0 ) 将零转型为TY ...

  5. (转)内核container_of(ptr,type,member) 解析

     container_of(ptr,type,member) 用于在已知结构体里面成员member和该成员指针ptr(就是地址)和结构体类型type, 返回该成员所在的结构体的指针(就是地址), 例如 ...

  6. mybatis No enum const class org.apache.ibatis.type.JdbcType.Date 坑爹的配置

    转自:https://lihaiming.iteye.com/blog/2248059 在ibatis中不需要关注这些参数 而转到mybatis后 如果字段值为空 必须设置jdbcType如inser ...

  7. list_entry(ptr, type, member)——知道结构体内某一成员变量地址,求结构体地址

    #define list_entry(ptr, type, member) \ ((type *)(() -> member))) 解释: 1 在0这个地址看做有一个虚拟的type类型的变量,那 ...

  8. 对list_entry(ptr, type, member)的理解

    如何根据一个结构体成员的地址.结构体类型以及该结构体成员名获得该结构体的首地址? #define list_entry(ptr, type, member) \ ((type *)((char *)( ...

  9. #define IOFFSETOF(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)

    #include <iostream> #define IOFFSETOF(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) usi ...

随机推荐

  1. c语言数据结构复习

    1)线性表 //顺序存储下线性表的操作实现 #include <stdio.h> #include <stdlib.h> typedef int ElemType; /*线性表 ...

  2. 浅谈Android样式开发之View Animation (视图动画)

    引言 一个用户体验良好的App肯定少不了动画效果.Android为我们提供了2种动画框架,分别是视图动画(View Animation)和属性动画(Property Animation).视图动画比较 ...

  3. Mac下Jenkins+SVN+Xcode构建持续

    1 安装Jenkins Jenkins是基于Java开发的一种持续集成工具.所以呢,要使用Jenkins必须使用先安装JDK. JDK安装 JDK 下载地址 jdk 1.8.png 安装JDK的过程略 ...

  4. Android:TextView文字跑马灯的效果实现

    解决TextView文字显示不全的问题. 简单设置跑马灯的效果: <TextView android:id="@+id/textView" android:layout_wi ...

  5. Selector

    原文: https://developer.apple.com/library/ios/documentation/General/Conceptual/DevPedia-CocoaCore/Sele ...

  6. Java 中正确获取中文字符串长度

    /** * 获取字符串的长度,如果有中文,则每个中文字符计为2位 * * @param value * 指定的字符串 * * @return 字符串的长度 */ public static int l ...

  7. less入门

    less入门 安装 首先安装node,执行命令 node install -g less安装完成后可以在任意窗口中使用lessc命令,将.less文件编译成css文件. 变量 可以像其他语言一样声明变 ...

  8. JS学习:第二周——NO.3盒子模型

    1.CSS盒子模型包括四个部分组成:设定的宽高+padding+border+margin: 2.JS盒子模型:通过系统提供的属性和方法,来获取当前元素的样式值   JS提供的属性和方法: clien ...

  9. 【HEOI2012】采花 BZOJ2743

    Description 萧芸斓是Z国的公主,平时的一大爱好是采花. 今天天气晴朗,阳光明媚,公主清晨便去了皇宫中新建的花园采花.花园足够大,容纳了n朵花,花有c种颜色(用整数1-c表示),且花是排成一 ...

  10. oracle 学习笔记(一)

    1. 数据库原理 1.1. 数据库简介 1.1.1. 文件存储 对数据的存储需求一直存在.保存数据的方式,经历了手工管理.文件管理等阶段,直至数据库管理阶段. 文件存储方式保存数据的弊端: 缺乏对数据 ...