public static async Task <HttpResponseMessage> UserChirpsPost( [HttpTrigger(AuthorizationLevel.Function, "post", Route = "user/{userId}/chirps")] HttpRequestMessage req, [DurableClient] IDurableClient client, ILogger log, string userId) { Authenticate(req, userId); var chirp = new Chirp() { UserId = userId, Timestamp = DateTime.UtcNow, Content = await req.Content.ReadAsStringAsync(), }; await client.SignalEntityAsync <IUserChirps>(userId, x => x.Add(chirp)); return(req.CreateResponse(HttpStatusCode.Accepted, chirp)); }
public void Add(Chirp chirp) { Chirps.Add(chirp); }