Esempio n. 1
0
        public async Task DeleteTopicByIdAsync_DeleteWithId1_DeletesItem()
        {
            var numberOfItemsInDatabase = await _context.Topics.CountAsync();

            await _service.DeleteTopicByIdAsync(1);

            _context.Topics.CountAsync().Result.Should().Be(numberOfItemsInDatabase - 1);
            _context.Topics.FindAsync(1).Result.Should().BeNull();
        }
        public async Task <IActionResult> DeleteConfirmed(int id)
        {
            await _topicService.DeleteTopicByIdAsync(id);

            return(RedirectToAction(nameof(Index)));
        }