2017-03-07 44 views
0

如何使用docuementdb天青功能http綁定綁定:Azure的功能documentdb輸出參數錯誤

using System.Net; 

public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, out object locationDocument, TraceWriter log){ 
    log.Info("C# HTTP trigger function processed a request."); 
    var data = await req.Content.ReadAsStringAsync(); 

    return req.CreateResponse(HttpStatusCode.OK, $"{data}"); 
} 

收到此錯誤:

error CS1988: Async methods cannot have ref or out parameters 

回答

1

這不是特定於文檔數據庫。如果你的函數是異步的,並且你已經使用HTTP輸出綁定的返回值,那麼你需要爲所有其他輸出綁定注入IAsyncCollector<T>

查看第二個例子in this answer