Ejemplo n.º 1
0
        public void DeletePlatformType(PlatformDTO platform)
        {
            var platformToDelete = _unitOfWork.PlatformTypeRepository.FindById(platform.Id);

            _unitOfWork.PlatformTypeRepository.Remove(platformToDelete);
            _unitOfWork.Commit();
        }
Ejemplo n.º 2
0
        public void CreateNewPlatformType(PlatformDTO platform)
        {
            PlatformType entity = new PlatformType();

            Mapper.Map(platform, entity);
            _unitOfWork.PlatformTypeRepository.Create(entity);
        }
Ejemplo n.º 3
0
        public void EditPlatformType(PlatformDTO platform)
        {
            var platformToEdit = _unitOfWork.PlatformTypeRepository.FindById(platform.Id);

            Mapper.Map(platform, platformToEdit);
            _unitOfWork.PlatformTypeRepository.Update(platformToEdit);
            _unitOfWork.Commit();
        }
Ejemplo n.º 4
0
        public IEnumerable <GameShowDTO> GetGamesByPlatformType(PlatformDTO platform)
        {
            PlatformType platformEntity = new PlatformType();

            Mapper.Map(platformEntity, platform);
            IEnumerable <Game>        games  = _unitOfWork.GameRepository.Get(i => i.PlatformTypes.Contains(platformEntity));
            IEnumerable <GameShowDTO> result = new List <GameShowDTO>();

            Mapper.Map(games, result);
            return(result);
        }