'Date' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported

后端 未结 8 554
粉色の甜心
粉色の甜心 2020-11-27 05:57

I am trying to execute the following code and am receiving an error

public List GetLoggingData(DateTime LogDate, string title)
{
     var context          


        
8条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-27 06:25

    Convert LongDate to .ToShortDateStringand then you can use it this way:

    EntityFunctions.TruncateTime(t.Timestamp) == LogDate
    

    like mike did

提交回复
热议问题