Convert string to long type and use in a linq query within asp.net MVC

前端 未结 4 893
清酒与你
清酒与你 2021-01-21 13:43

Is it possible within Linq in C#, to convert a string field in a database, to a long type - and use it in the query?

Here, tme is a unix time (long) - but the field in t

4条回答
  •  情书的邮戳
    2021-01-21 14:23

    You have to either change the database table to not store a string or compare the value as string. The reason is that Entity Framework LINQ provider does not understand long.Parse and there is no method in SqlFunctions class for this purpose.please use long.Parse()

提交回复
热议问题