Итак, проблема, с которой я столкнулся, заключается в том, что я не могу снова использовать «ID», он продолжает выдавать мне ошибку для моего CosmosDBOutput, я не уверен, почему это так, но мне нужна помощь, если кто-нибудь может помочь исправить это. это.
Вот код, который у меня есть на данный момент, и я использую .Net 6 LTS с использованием C#
Код: Выделить всё
using System;
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Microsoft.Azure.Functions.Worker;
using System.Net.Http;
using System.Text;
namespace Company.Function
{
public static class GetResumeCounter
{
[FunctionName("GetResumeCounter")]
public static HttpResponseMessage Run(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
[CosmosDBInput(databaseName:"AzureResume", containerName: "Counter", Connection = "AzureResumeConnectionString", Id = "1", PartitionKey = "1")] Counter counter,
[CosmosDBOutput(databaseName:"AzureResume", containerName: "Counter", Connection = "AzureResumeConnectionString", Id = "1", PartitionKey = "1")] out Counter updatedcounter,
ILogger log)
{
log.LogInformation("C# HTTP trigger function processed a request.");
updatedcounter = counter;
updatedcounter.Count += 1;
var jsonToRetun = JsonConvert.SerializeObject(counter);
return new HttpResponseMessage(System.Net.HttpStatusCode.OK)
{
Content = new StringContent(jsonToRetun, Encoding.UTF8, "application/json")
};
}
}
}
The type or namespace name 'Id' could not be found (are you missing a using directive or an assembly reference?)
for my CosmosDBOutput please help
Источник: https://stackoverflow.com/questions/781 ... using-dire