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

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

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

            var people = _peopleRepository.GetByName(name);

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

            DelayService.Pause();

            return(_mapper.Map <PersonDto>(_peopleRepository.CreatePerson(entity)));
        }
Exemple #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));
        }
Exemple #5
0
        public PersonDto DeletePerson(int id)
        {
            DelayService.Pause();

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

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