应该使用什么代替已过时的EntityName.account.ToString()? [英] What should be used instead of the deprecated EntityName.account.ToString()?

查看:58
本文介绍了应该使用什么代替已过时的EntityName.account.ToString()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在设计 QueryExpression 时,我一直使用以下硬编码语法。

When I design a QueryExpression, I've always used the following, hard-coded syntax.

QueryExpression expression = new QueryExpression
{
  EntityName = "account";
  ...
}

此博客基于使用此枚举

QueryExpression expression = new QueryExpression
{
  EntityName = EntityName.account.ToString();
  ...
}

我更喜欢它,但我做不到不能使用智能感知来找到它。然后,我发现了此讨论,其中解释了不赞成使用的语法。

I liked it much better but I couldn't find it using intellisense. Then I've found this discussion where it's explained that the syntax is deprecated.

那么,应该用什么代替 EntityName ?我已经用谷歌搜索了一下,但是找不到有用的东西。在我看来,在硬编码表达式之前应首选某种枚举。那是对的吗?如果是这样,怎么在CRM 2011中做到这一点?

So, what should one use instead of EntityName? I've googled it a bit but can't find anything useful. It seems to me that some kind of enumeration is to be preferred before the hard-coded expression. Is that correct? And if so, how to do that in CRM 2011?

推荐答案

如果使用的是后期绑定实体,则可以使用 Entity.LogicalName

And if you are using late bound entities you can use Entity.LogicalName.

这篇关于应该使用什么代替已过时的EntityName.account.ToString()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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