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

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