public ActionResult DeleteConfirmed(long id) { DocumentsPost documents = _documentsService.GetPost(id); documents.UserName = User.Identity.Name; _documentsService.Delete(documents); return(RedirectToAction("Index")); }
public async Task <IActionResult> Delete(int id) { var affectedResult = await _documentsService.Delete(id); if (affectedResult == 0) { return(BadRequest()); } return(Ok()); }
public IActionResult DeleteDocuments(int id) { //var result = _IDocumentsService.Where(o => o.Id == id).Result.FirstOrDefault(); //var path = this.GetPathAndFilename(result.Link); //if (System.IO.File.Exists(path)) // System.IO.File.Delete(path); var resultDel = _IDocumentsService.Delete(id); _uow.SaveChanges(); return(Json(resultDel)); }