gpt4 book ai didi

c# - 在 QueryExpression 中包含 OptionSetValue

转载 作者:行者123 更新时间:2023-11-30 19:39:23 26 4
gpt4 key购买 nike

我需要查询一个 OptionSetValue 字段,以根据基于特定 ID 完成的查询查找事件记录。但是,每次执行下面的查询时,我都会收到以下错误:

the type with data contract name optionsetvalue is not expected

如何在 QueryExpression ConditionValues 属性中包含 OptionSetValue

queryEx = new QueryExpression
{
EntityName = "account",
ColumnSet = new ColumnSet(true),
Criteria =
{
FilterOperator = LogicalOperator.And,
Conditions =
{
new ConditionExpression
{
AttributeName = "neu_id",
Operator = ConditionOperator.Equal,
Values = {agency.ReferenceNumber}
},
new ConditionExpression
{
AttributeName = "neu_appointmentstatus",
Operator = ConditionOperator.Equal,
Values = {new OptionSetValue(279660000)}
}
}
}
};

EntityCollection collection = _client.RetrieveMultiple(queryEx);

最佳答案

在您的情况下,您需要设置选项集的整数值。所以代码将是:

new ConditionExpression
{
AttributeName = "neu_appointmentstatus",
Operator = ConditionOperator.Equal,
Values = 279660000
}

关于c# - 在 QueryExpression 中包含 OptionSetValue,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27788848/

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