LINQ to Entities does not recognize the method 'System.String StringConvert(System.Nullable`1[System.Double])

后端 未结 2 659
谎友^
谎友^ 2020-12-10 03:21

I can\'t figure out why I\'m getting this error. I have used this function successfully with previous versions of Entity Framework but I\'ve set up a new project using EF6 a

2条回答
  •  粉色の甜心
    2020-12-10 03:30

    I had the same problem and realized that I was using the wrong type of SqlFunctions. Make sure that you referenced the correct namespace:

    using System.Data.Entity.SqlServer;
    

    and not:

    using System.Data.Objects.SqlClient;
    

提交回复
热议问题