private async Task PrepRegattaVmAsync(RegattaWithOptionsViewModel model) { if (model.StartDate.HasValue) { var seasons = await _coreSeasonService.GetSeasons(model.ClubId); model.Season = seasons.Single(s => s.Start <= model.StartDate.Value && s.End >= model.StartDate.Value); } if (model.ScoringSystemId == Guid.Empty) { model.ScoringSystemId = null; } model.Fleets = new List <Fleet>(); var fleets = await _coreFleetService.GetAllFleetsForClub(model.ClubId); if (model.FleetIds != null) { foreach (var fleetId in model.FleetIds) { model.Fleets.Add(fleets .Single(f => f.Id == fleetId)); } } }
public async Task <IList <FleetSummary> > GetAllFleetSummary(string clubInitials) { var clubId = await _coreClubService.GetClubId(clubInitials); var coreFleets = await _coreFleetService.GetAllFleetsForClub(clubId); return(_mapper.Map <IList <FleetSummary> >(coreFleets)); }