Esempio n. 1
0
        public async Task <IActionResult> DeleteConfirmed(int id)
        {
            var product = await OperationsPro.FindAsync(m => m.Id == id);

            OperationsPro.Delete(product);
            return(RedirectToAction(nameof(Index)));
        }
 public ActionResult Delete(Book book)
 {
     try
     {
         books.Delete(book);
         return(RedirectToAction(nameof(List)));
     }
     catch
     {
         return(View());
     }
 }
Esempio n. 3
0
 public IActionResult DeleteConfirmed(int id)
 {
     _operations.Delete(_configuration.GetConnectionString("ConnectionString"), id);
     return(RedirectToAction(nameof(Index)));
 }
Esempio n. 4
0
 /// <summary>
 /// Removes the specified key. A key is ignored if it does not exist.
 /// </summary>
 /// <param name="key">The key of the object.</param>
 /// <returns></returns>
 public bool Delete(string key)
 {
     return(_operations.Delete(key));
 }