Azure API 管理 - 命名值
有没有办法让命名值记录文本和表达的组合。示例格式下面尝试实现的目标,不幸的是我尝试了所有的方式,但是表达式未得到评估。任何帮助都将非常感谢
评估到:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
有没有办法让命名值记录文本和表达的组合。示例格式下面尝试实现的目标,不幸的是我尝试了所有的方式,但是表达式未得到评估。任何帮助都将非常感谢
评估到:
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
您正在使用单一的表达行,在这种情况下,该行未正确评估。相反,使用将按预期工作的多行表达式。
您正在尝试的代码段:
@{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;

Output scrrenshot: