public async Task <IActionResult> DeleteAsync(int id) { var result = await _supplierRepository.DeleteAsync(id); return(Ok(result)); }
public async Task <IActionResult> DeleteConfirmed(int id) { var suppliers = await _supplierRepository.GetOneAsync(id); await _supplierRepository.DeleteAsync(suppliers); return(RedirectToAction(nameof(Index))); }
public async Task <IActionResult> DeleteProduct(int productId) { Product deletedProduct = await _supplierRepository.GetByIdAsync(productId); var result = await _supplierRepository.DeleteAsync(deletedProduct); if (!result) { return(BadRequest("Could not delete product")); } return(Ok()); }
public async Task <IActionResult> DeleteById(int id) { var result = await _suppliers.DeleteAsync(id); if (result) { return(Ok("Supplier deleted Successfully")); } else { return(BadRequest("Something Went Wrong while deleting")); } }
public async Task <ActionResult> Delete(Guid id) { try { var result = shipperRepo.Retrieve().FirstOrDefault(x => x.SupplierID == id); if (result == null) { return(NotFound()); } await shipperRepo.DeleteAsync(id); return(NoContent()); } catch (Exception) { return(BadRequest()); } }
public async Task <bool> DeleteSupplier(SupplierDto dto) { return(await _supplierRepository.DeleteAsync(dto)); }
public async Task <bool> DeleteAsync(int id) => await _supplierRepository.DeleteAsync(id);
public async Task RemoveAsync(int id) { await _supplierRepository.DeleteAsync(id); }