public async Task <IEnumerable <Season> > GetSeasons([FromRoute] string leagueName) { var league = await _leaguesRepository.GetDocumentByName(leagueName); var seasons = await _seasonsRepository.GetDocumentListByIds(league.Seasons); return(seasons); }
public async Task <ResponseDto <int> > AddSharedDocument(string recipient, string documentName) { var document = await _documentsRepository.GetDocumentByName(documentName); var response = DocumentsValidator.ValidateSendMail(document); if (response.HasErrors) { return(response); } var sharedDocument = CreateSharedDocument(recipient, documentName); await _sharedDocumentsRepository.AddSharedDocument(sharedDocument); response.Value = sharedDocument.Id; return(response); }
public async Task <League> Get([FromRoute] string name) { var league = await _leaguesRepository.GetDocumentByName(name); return(league); }
public async Task <Team> Get([FromRoute] string name) { var team = await _teamsRepository.GetDocumentByName(name); return(team); }