コード例 #1
0
        public async Task <Response> DeleteABook(int bookID)
        {
            Response response = new Response();

            if (bookID == 0)
            {
                return(response);
            }
            var result = await _repositoryCommand.Delete(bookID);

            response.Data = result;
            return(response);
        }
コード例 #2
0
        public async Task <Response> Delete(int id)
        {
            var response = new Response();

            if (id == 0)
            {
                return(response);
            }
            var result = await _repositoryCommand.Delete(id);

            response.Data = result;
            return(response);
        }
コード例 #3
0
 public ActionResult Delete(int id, Permission permission)
 {
     try
     {
         _permissionCommand.Delete(id);
         _permissionCommand.Save();
         TempData["MESSAGE"] = "Permission " + permission.Name + " was successfully deleted";
         ModelState.Clear();
         return(RedirectToAction("Index"));
     }
     catch (Exception exp)
     {
         _log.Error(exp);
         return(View("Error"));
     }
 }