in Functions.Templates/Templates/DurableFunctionsEntityHttpStart-CSharp-2.x/run.csx [9:24]
public static async Task<IActionResult> Run(
HttpRequest req,
IDurableEntityClient client,
string entityKey)
{
var entityId = new EntityId("Counter", entityKey);
if (req.Method.Equals("POST"))
{
await client.SignalEntityAsync(entityId, "add", 1);
return new OkObjectResult("Added to the entity");
}
EntityStateResponse<JToken> stateResponse = await client.ReadEntityStateAsync<JToken>(entityId);
return new OkObjectResult(stateResponse);
}