public async Task <IActionResult> DeleteConfirmed(string id) { var dataEntry = await _context.GetById(id); await _context.Delete(dataEntry); return(RedirectToAction(nameof(Index))); }
public async Task <IActionResult> Delete(string id) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var dataEntry = await _dataentryRepository.GetById(id); if (dataEntry == null) { return(NotFound()); } await _dataentryRepository.Delete(dataEntry); await _unitOfWork.CompleteAsync(); return(Ok()); }