public async Task Delete(int id) { var hotel = applicationContext.Hotels .SingleOrDefault(h => h.HotelId == id) ?? throw new ItemNotFoundException(localizer["Hotel with id: {0} is not found.", id]); applicationContext.Hotels.Remove(hotel); await applicationContext.SaveChangesAsync(); await thumbnailService.DeleteAsync(id); await imageService.DeleteAllFileAsync(id); }