示例#1
0
    public async Task <IEnumerable <RegattaSummaryViewModel> > GetAllRegattaSummaryAsync(string clubInitials)
    {
        var clubId = await _clubService.GetClubId(clubInitials);

        var regattas = await _coreRegattaService.GetAllRegattasAsync(clubId);

        var orderedRegattas = regattas
                              .OrderByDescending(s => s.Season.Start)
                              .ThenBy(s => s.StartDate)
                              .ThenBy(s => s.Name);

        return(_mapper.Map <IList <RegattaSummaryViewModel> >(orderedRegattas));
    }
示例#2
0
    public async Task <Club> GetClubForClubHome(string clubInitials)
    {
        var clubId = await _coreClubService.GetClubId(clubInitials);

        var club = await _coreClubService.GetMinimalClub(clubId);

        // 10 days back, but view filters down to 8 days back.
        club.Races = await _coreRaceService.GetRecentRacesAsync(clubId, 10);

        club.Series = await _coreSeriesService.GetAllSeriesAsync(clubId, null, false);

        club.Regattas = await _coreRegattaService.GetAllRegattasAsync(clubId);

        return(club);
    }