public async Task DeleteAsync_DeletesEntity() { // Arrange var expectedCount = await _context.QueueMembers.CountAsync(); // Act await _queueMemberService.DeleteByIdAsync(1); var resultCount = await _context.QueueMembers.CountAsync(); // Assert resultCount.Should().Be(expectedCount - 1); }
public async Task <IActionResult> Delete(int id) { await _queueMemberService.DeleteByIdAsync(id); return(Ok()); }
public async Task <IActionResult> DeleteConfirmed(int id) { await _service.DeleteByIdAsync(id); return(RedirectToAction(nameof(Index))); }