简体   繁体   中英

Azure API Management - Named Values

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

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; } @{ string str1= "This is date: "; string str2 = (DateTime.Now.ToString()); return str1+str2; }

The named value propery will look as below; 在此处输入图像描述 Output scrrenshot: 在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM