Azure API 管理 - 命名值

发布于 2025-01-17 21:14:16 字数 272 浏览 1 评论 0 原文

有没有办法让命名值记录文本和表达的组合。示例格式下面尝试实现的目标,不幸的是我尝试了所有的方式,但是表达式未得到评估。任何帮助都将非常感谢

“

评估到:
“

Is there a way to have the Named Values record a combination of Text and Expression. Sample format what am trying to achieve is given below, unfortunately I tried all the ways but the expression isn't getting evaluated. Any help is greatly appreciated

Named Values Sample

Evaluated to:
Trace log

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冷心人i 2025-01-24 21:14:16

您正在使用单一的表达行,在这种情况下,该行未正确评估。相反,使用将按预期工作的多行表达式。
您正在尝试的代码段:@{String str1 =“这是日期:”;字符串str2 =(dateTime.now.toString());返回str1+str2; }

命名值propery将如下; “在此处输入图像描述”

You are using single line of expression, which is not evaluating correctly in this case. Instead, use a multi line expression which will work as expected.
Code snippet for what you are trying: @{ string str1= "This is date : " ; string str2 = (DateTime.Now.ToString()); return str1+str2 ; }

The named value propery will look as below;enter image description here
Output scrrenshot: enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文