function:
public static dynamic GetAppSecret() { //string[] result = new string[] { "", "" }; dynamic result = new System.Dynamic.ExpandoObject(); result = new { appid="appid", appSecret = "appSecret" }; return result; }
if you want to use the dynamic result function in a difference assembly, you should add following code to assemblyInfo.cs
[assembly: InternalsVisibleTo("WeChatSchools")]
invoke:
var secret = Helper.GetAppSecret(); app.t_appid = secret.appid; app.t_appkey = secret.appSecret;
C# return dynamic/anonymous type value as function result,布布扣,bubuko.com
C# return dynamic/anonymous type value as function result
原文:http://www.cnblogs.com/zyip/p/3643447.html