예제 #1
0
        public async Task DeleteEntityAsync(Guid entityId)
        {
            var flightFromRepo = await _repository.GetEntityAsync(entityId);

            if (flightFromRepo == null)
            {
                throw new NotFoundException();
            }

            await _repository.DeleteEntityAsync(flightFromRepo);

            if (!_repository.SaveAsync().Result)
            {
                throw new Exception("Deleting Flight failed on save.");
            }
        }