public VoidResult DeleteAsset(int assetId) { var deleteAsset = _assetRepository.GetById(assetId); if (deleteAsset != null) { _assetRepository.Delete(assetId); return(VoidResult.Ok()); } else { return(VoidResult.CreateFaultedResult("The asset can't be found.")); } }
public VoidResult DeleteCustomer(int customerId) { var deleteCustomer = _customerRepository.GetById(customerId); if (deleteCustomer != null) { _customerRepository.Delete(deleteCustomer.Id); return(VoidResult.Ok()); } else { return(MethodResult <Customer> .CreateFaultedResult("The customer with this Id can't be found.")); } }
public VoidResult DeleteUser(int userId) { var deleteUser = _userRepository.GetById(userId); if (deleteUser != null) { _userRepository.Delete(deleteUser.Id); return(VoidResult.Ok()); } else { return(VoidResult.CreateFaultedResult("The user can't be found.")); } }
public VoidResult DeleteTicketItem(int id) { var deleteTicketItem = _ticketItemRepository.GetById(id); if (deleteTicketItem != null) { _ticketItemRepository.Delete(id); return(VoidResult.Ok()); } else { return(VoidResult.CreateFaultedResult("The ticketItem can't be found.")); } throw new NotImplementedException(); }