コード例 #1
0
        public ActionResult DeleteConfirmed(long id)
        {
            DocumentsPost documents = _documentsService.GetPost(id);

            documents.UserName = User.Identity.Name;
            _documentsService.Delete(documents);
            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public async Task <IActionResult> Delete(int id)
        {
            var affectedResult = await _documentsService.Delete(id);

            if (affectedResult == 0)
            {
                return(BadRequest());
            }
            return(Ok());
        }
コード例 #3
0
        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));
        }