Example #1
0
        public async Task <bool> RemoveTravelAsync(int tId)
        {
            var t = new TravelEntity()
            {
                id = tId
            };

            return(await TravelRepository.DeleteAsync(t));
        }
Example #2
0
        public async Task <bool> DeleteTravel(Guid id)
        {
            var travelToDelete = await TravelRepository.GetByIdAsync(id);

            if (travelToDelete == null)
            {
                throw new NotFoundException("Путешествие не найдено!");
            }

            await TravelRepository.DeleteAsync(travelToDelete);

            return(true);
        }