gpt4 book ai didi

c# - Target 始终是 Entity 还是可以是 EntityReference?

转载 作者:太空狗 更新时间:2023-10-30 00:19:55 26 4
gpt4 key购买 nike

我发现在我的一些代码中我有以下语法来保护插件免受 FUBARing 攻击。看在上帝的份上,我不能不记得为什么我将分离条件设置为 EntityReference

Context.InputParameters["Target"] 是不是每个 EntityReference

bool goodToGo 
= Context.InputParameters.Contains("Target")
&& Context.PrimaryEntityName == "email";
&& (
Context.InputParameters["Target"] is Entity
|| Context.InputParameters["Target"] is EntityReference);

除了实体之外,它是否曾经任何

最佳答案

Target 也可以是 EntityReference,来自 MSDN:

Note that not all requests contain a Target property that is of type Entity, so you do have to look at each individual request or response. For example, DeleteRequest does have a Target property but its type is EntityReference.

Understand the Data Context Passed to a Plug-In

因此,根据您的插件逻辑,您可能还需要检查 EntityReference 的属性类型。

关于c# - Target 始终是 Entity 还是可以是 EntityReference?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15613026/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com