private IList <PlayTableCountModel> GetTablesWithUserCount() { var tables = _playTableService.GetAllTables(); var model = _mapper.Map <IList <PlayTableCountModel> >(tables); foreach (var table in model) { table.UserCount = _playTableService.TableUserCount(table.Id); } return(model); }
public static IList <PlayTableCountModel> GetTablesWithUserCount(IPlayTableService playTableService, IMapper mapper) { var tables = playTableService.GetAllTables(); var model = mapper.Map <IList <PlayTableCountModel> >(tables); foreach (var table in model) { table.UserCount = playTableService.TableUserCount(table.Id); } return(model); }