public async Task SpectatorTable() { int userId; PlayTableStaeModel state = null; if (TryParsUserId(out userId)) { var viewer = _tablesService.GetTableViewerByUserId(userId); if (viewer != null) { state = TableHubUtils.GetTableState(viewer.tableId, _tablesService, _mapper); } } await Clients.User(Context.UserIdentifier).SpectatorTable(state); }
public static ViewWerModel GetViewWerModel(int userId, IPlayTableService playTableService, IMapper mapper) { var viewer = playTableService.GetTableViewerByUserId(userId); return(viewer == null ? null : mapper.Map <ViewWerModel>(viewer)); }