public async Task <ActionResult <User> > PostUserGroupAsync([FromBody] UserGroup userGroup) { _logger.LogInformation($"Creating user[{userGroup.UserId}] group[{userGroup.GroupId}] connection..."); var(user, group) = await _service.CreateUserGroupAsync(userGroup.UserId, userGroup.GroupId); await _hubContext.Clients.All.UserJoinedAsync(user.Name, group.Name); _logger.LogInformation($"Created user[{userGroup.UserId}] group[{userGroup.GroupId}] connection."); return(_mapper.Map <User>(user)); }