public static async Task CreateRoom( [ActivityTrigger] string username, [Table(nameof(Room))] CloudTable table, [Queue(Global.QUEUE)] IAsyncCollector <string> console, ILogger logger) { logger.LogInformation("Create room for user {user}", username); var client = table.AsClientFor <Room>(); var room = _roomMaker.GetNewRoom(username); await client.InsertAsync(room); await console.AddAsync($"{room.Name} has been prepared for {username}!"); logger.LogInformation("Creation of {room} for user {user} successful", room.Name, username); }
public static async Task CreateRoom( [ActivityTrigger] string username, [OrchestrationClient] IDurableOrchestrationClient client, [Queue(Global.QUEUE)] IAsyncCollector <string> console, ILogger logger) { logger.LogInformation("Create room for user {user}", username); var room = _roomMaker.GetNewRoom(); var id = username.AsEntityIdFor <Room>(); await client.SignalEntityAsync <IRoomOperations>(id, operation => operation.New(room.Name)); await client.SignalEntityAsync <IRoomOperations>(id, operation => operation.SetDescription(room.Description)); await console.AddAsync($"{room.Name} has been prepared for {username}!"); logger.LogInformation("Creation of {room} for user {user} successful", room.Name, username); }