Esempio n. 1
0
        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);
 }
Esempio n. 3
0
        public List <Sport> GetAll()
        {
            var sportList = _repository.GetAll <Domain.Entities.Sport>();

            return(Mapping.Mapped.Map <List <Sport> >(sportList));
        }
Esempio n. 4
0
 public List <Sport> GetAllSports()
 {
     return(_sportRepository.GetAll());
 }
Esempio n. 5
0
 // GET: api/Sports
 public IQueryable <Sport> GetSports()
 {
     return(sportRepository.GetAll());
 }