public async Task PostAccount(
            [HttpTrigger(AuthorizationLevel.Function, "post", Route = "accounts/{accountId}")] HttpRequestMessage request,
            string accountId,
            [DurableClient] IDurableEntityClient client
            )
        {
            var account = await request.Content.ReadAsAsync <PostAccountRequest>();

            var message = new CreateAccountMessage(account.AccountNumber, account.Balance);
            await client.SignalEntityAsync <IAccountEntity>(accountId, account => account.Create(message));
        }
Esempio n. 2
0
 public Task Create(CreateAccountMessage message)
 {
     AccountNumber = message.AccountNumber;
     Balance       = message.Balance;
     return(Task.CompletedTask);
 }