Can't get EntityFunctions.TruncateTime() to work

前端 未结 3 1568
Happy的楠姐
Happy的楠姐 2020-12-05 04:15

I am using Entity Framework Code First. Using LINQ to Entity I want to grab a record based on a DateTime value. Here is my current code:

/// 
         


        
3条回答
  •  青春惊慌失措
    2020-12-05 05:12

    I didn't remove the reference System.Data.Entity, I just changed the call from DbFunctions.TruncateTime to System.Data.Entity.DbFunctions.TruncateTime and it worked for me.

    I'm using Entity 6.

提交回复
热议问题