public ICollection <SportDto> GetAllSports() { authenticator.Authenticate(); ICollection <Sport> allOfThem; try { allOfThem = sports.GetAll(); } catch (DataInaccessibleException e) { throw new ServiceException(e.Message, ErrorType.DATA_INACCESSIBLE); } return(allOfThem .Select(s => mapper.ToDto(s)) .ToList()); }
public void AddSportTest() { sportStorage.Add(sportA); Assert.AreEqual(1, sportStorage.GetAll().Count); }
public List <Sport> GetAll() { var sportList = _repository.GetAll <Domain.Entities.Sport>(); return(Mapping.Mapped.Map <List <Sport> >(sportList)); }
public List <Sport> GetAllSports() { return(_sportRepository.GetAll()); }
// GET: api/Sports public IQueryable <Sport> GetSports() { return(sportRepository.GetAll()); }