GetDate() using Entity Framework

前端 未结 3 576
你的背包
你的背包 2021-01-20 15:23

I am trying to use entity framework and get the date from the SQL server. The old way of doing this in LINQ is below but i\'m needing something for the entity framework:

3条回答
  •  说谎
    说谎 (楼主)
    2021-01-20 15:55

    Search at google "efquerysamples" entity framework samples and download those good examples then look canonical function CurrentDateTime(), it worked with:

    DateTime fecha = ServicioContexto.Contexto.CreateQuery("CurrentDateTime()").Execute(MergeOption.NoTracking).First();

    I'd like to understand more about canonical functions. Please explain me. Thank you

提交回复
热议问题