.ToString()的规范EntityFunction的方法 [英] Which method of canonical EntityFunctions for .ToString()

查看:200
本文介绍了.ToString()的规范EntityFunction的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  JobLinkId = jobItem.joblinkid.ToString()

它会引发错误,因为它是C#函数。我应该使用哪种EF规范函数?

解决方案

我猜你试图使用<$在$ code> Linq to Entities 查询中,c $ c> ToString 如果是这样,那么它不可能在那里使用它。我知道的唯一的方法是使用 ToList 查询,然后使用 Linq to Objects 获取 ToString


I am using EF and if I use expression like:

JobLinkId = jobItem.joblinkid.ToString()

it throws error because it is C# function. Which method of EF canonical functions should I use for this?

解决方案

I'm guessing that you're trying to use ToString in Linq to Entities query. If so then its impossible to use it there. The only walkaround i know is to use ToList on query and then use Linq to Objects to get result with ToString.

这篇关于.ToString()的规范EntityFunction的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆