我正在尝试使用 cosmos DB 输入绑定创建一个 Azure 函数 HttpTrigger。但它给了我一个类型错误。
这是我正在尝试的:
public static async Task<IActionResult> Run(IReadOnlyList<Document> inputDocs, HttpRequest req, IAsyncCollector<Document> outputDocs, ILogger log)
{
}
它给了我以下错误:
2019-06-03T06:48:35.646 [Error] Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.HttpTrigger1'. Microsoft.Azure.WebJobs.Host: Can't bind CosmosDB to type 'System.Collections.Generic.IReadOnlyList`1[Microsoft.Azure.Documents.Document]'.
Possible causes:
1) Tried binding to 'Microsoft.Azure.Documents.Client.DocumentClient, Microsoft.Azure.DocumentDB.Core, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' but user type assembly was 'System.Collections.Generic.IReadOnlyList`1[[Microsoft.Azure.Documents.Document, Microsoft.Azure.DocumentDB.Core, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]], System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e.
2) Tried binding to 'Newtonsoft.Json.Linq.JArray, Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' but user type assembly was 'System.Collections.Generic.IReadOnlyList`1[[Microsoft.Azure.Documents.Document, Microsoft.Azure.DocumentDB.Core, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]], System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e.
3) Tried binding to 'System.Collections.Generic.IEnumerable`1[[Microsoft.Azure.WebJobs.Extensions.CosmosDB.CosmosDBExtensionConfigProvider+DocumentOpenType, Microsoft.Azure.WebJobs.Extensions.CosmosDB, Version=3.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]], System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' but user type assembly was 'System.Collections.Generic.IReadOnlyList`1[[Microsoft.Azure.Documents.Document, Microsoft.Azure.DocumentDB.Core, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]], System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e.
任何人都可以帮我输入类型吗?