Beispiel #1
0
        public PaginatedResults <PersonDto> GetAll(PaginationOptions options)
        {
            DelayService.Pause();

            var results = _peopleRepository.GetAll().ToList();

            return(_paginationService.GetPaginatedResults <Person, PersonDto>(results, options));
        }
Beispiel #2
0
        public PaginatedResults <PersonDto> GetPeopleByName(string name, PaginationOptions options)
        {
            DelayService.Pause();

            var people = _peopleRepository.GetByName(name);

            return(_paginationService.GetPaginatedResults <Person, PersonDto>(people, options));
        }
Beispiel #3
0
        public PersonDto CreatePerson(PersonDto muppet)
        {
            var entity = _mapper.Map <Person>(muppet);

            DelayService.Pause();

            return(_mapper.Map <PersonDto>(_peopleRepository.CreatePerson(entity)));
        }
Beispiel #4
0
        public PersonDto UpdatePerson(PersonDto update)
        {
            var entity = _mapper.Map <Person>(update);

            if (update.Interests == null)
            {
                entity.Interests = null;
            }

            DelayService.Pause();

            var updatedPerson = _peopleRepository.UpdatePerson(entity);

            return(_mapper.Map <PersonDto>(updatedPerson));
        }
Beispiel #5
0
        public PersonDto DeletePerson(int id)
        {
            DelayService.Pause();

            return(_mapper.Map <PersonDto>(_peopleRepository.DeletePerson(id)));
        }
Beispiel #6
0
        public PersonDto GetPersonById(int id)
        {
            DelayService.Pause();

            return(_mapper.Map <PersonDto>(_peopleRepository.GetPersonById(id)));
        }