Exemplo n.º 1
0
        public void UpdatePerformance(PerformanceDTO performanceDTO)
        {
            Performance performance = _mapper.Map <Performance>(performanceDTO);

            _unit.PerformanceRepository.Update(performance);
            _unit.Save();
        }
Exemplo n.º 2
0
        public PerformanceDTO GetPerformance(int id)
        {
            Performance performance = _unit.PerformanceRepository.Get(id);

            if (performance == null)
            {
                throw new NotFoundException("Performance is not found");
            }
            PerformanceDTO perf = _mapper.Map <PerformanceDTO>(performance);

            return(perf);
        }
Exemplo n.º 3
0
        public IEnumerable <PerformanceDTO> GetAllPerformances()
        {
            IEnumerable <Performance> performances    = _unit.PerformanceRepository.GetAll();
            List <PerformanceDTO>     performancesDTO = new List <PerformanceDTO>();

            foreach (Performance p in performances)
            {
                PerformanceDTO perf = _mapper.Map <PerformanceDTO>(p);
                performancesDTO.Add(perf);
            }
            return(performancesDTO);
        }