public void DeletePlatformType(PlatformDTO platform) { var platformToDelete = _unitOfWork.PlatformTypeRepository.FindById(platform.Id); _unitOfWork.PlatformTypeRepository.Remove(platformToDelete); _unitOfWork.Commit(); }
public void CreateNewPlatformType(PlatformDTO platform) { PlatformType entity = new PlatformType(); Mapper.Map(platform, entity); _unitOfWork.PlatformTypeRepository.Create(entity); }
public void EditPlatformType(PlatformDTO platform) { var platformToEdit = _unitOfWork.PlatformTypeRepository.FindById(platform.Id); Mapper.Map(platform, platformToEdit); _unitOfWork.PlatformTypeRepository.Update(platformToEdit); _unitOfWork.Commit(); }
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); }