今日碰到这样的问题 ,接口回调的值可以打印出来。但是js回调里面显示为空 ,接口处于等待状态,
public async Task<IEnumerable<string>> Get(string s)
{
Log.InfoFormat(ITCloudLogType.common, "Begin Request.thread id:{0},time:{1},requestId:{2}", Thread.CurrentThread.ManagedThreadId, DateTime.Now.ToLongTimeString(), this.ControllerContext.Request.GetCorrelationId().ToString());
await Task.Run(()=>Job1(s));
Log.InfoFormat(ITCloudLogType.common, "End Request.id:{0},time:{1},requestId:{2}", Thread.CurrentThread.ManagedThreadId, DateTime.Now.ToLongTimeString(), this.ControllerContext.Request.GetCorrelationId().ToString());
return new string[] { "value1", "value2" };
}
private void Job1(string s)
{
return;
}
private int Job2()
{
return 2;
}