DeadnTangy
DeadnTangy
CC#
Created by DeadnTangy on 5/9/2024 in #help
Unsure what this error means
i was reading about async and using await. if use async it gives an error for the updatedCounter. I was ignoring it for now
11 replies
CC#
Created by DeadnTangy on 5/9/2024 in #help
Unsure what this error means
using System; using System.Net; 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 System.Net.Http; using System.Text; using Microsoft.Azure.WebJobs.Extensions.CosmosDB; using System.Linq.Expressions; using Microsoft.Azure.Cosmos; namespace Company.Function { public static class getVisitorCounter { [FunctionName("getVisitorCounter")] public static Task<IActionResult> Run( [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req, [CosmosDB(databaseName:"AzureResume",containerName:"Counter", Connection = "AzureResumeConnectionString", Id = "1", PartitionKey = "1")] Counter counter, [CosmosDB(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") }; } } }
11 replies
CC#
Created by DeadnTangy on 5/9/2024 in #help
Unsure what this error means
sure its not long at all one second
11 replies