public ActionResult DeleteConfirmed(System.Guid id) { producttypeRepository.Delete(id); producttypeRepository.Save(); return(RedirectToAction("Index")); }
[HttpDelete("eliminar/{id:int}")] // Metodo DELETE para eliminar elemento public IActionResult Delete(int id) { var productType = _productTypeRepository.Delete(id); // Eliminar elemento var productTypeDto = _mapper.Map <ProductTypeDto>(productType); // Mapear entitidad a dto return(Ok(productTypeDto)); }
public IActionResult DeleteConfirmed(int id) { var productType = _context.GetByID(id); _context.Delete(productType); return(RedirectToAction(nameof(Index))); }
public bool DeleteType(ProductType type) { if (type == null) { throw new ArgumentNullException(nameof(type)); } return(ExecuteFaultHandledOperation(() => { _report_prod_type.Delete(_prod_es.Map(type)); return true; })); }
public bool Delete(string id) { try { ProductType productType = _productTypeRepository.Get(id); _productTypeRepository.Delete(productType); _productTypeRepository.Save(RequestContext); return(true); } catch (Exception) { return(false); } }
public async Task <IActionResult> DeleteProductType(int id) { if (!_auth.IsAppAdmin(User)) { return(NoContent()); } var productTypeFromRepo = await _repo.GetProductType(id); if (productTypeFromRepo == null) { return(BadRequest($"Product Type {id} could not be found.")); } _repo.Delete(productTypeFromRepo); if (await _repo.SaveAll()) { return(Ok()); } return(BadRequest("Failed to delete product type.")); }
public void Delete(int id) { _repository.Delete(id); }
public ProductType Delete(int id) { return(_productTypeRepository.Delete(id)); }
public void DeleteProductType(string keyValue) { var entity = typeApp.FindEntity(keyValue); typeApp.Delete(entity); }
public void Delete(int id) { _productTypeRepository.Delete(id); }
public void Delete(Guid id) { var entity = productTypeRepository.GetById(id); productTypeRepository.Delete(entity); productTypeRepository.SaveChanges(); }
public void DeleteProductType(int id) { var productType = productTypeRepository.GetBy(id); productTypeRepository.Delete(productType); }