public IHttpActionResult Deactivate(int id) { Suppliers _suppliers = _unitOfWork.Suppliers.GetSupplierWithId(id); if (_suppliers == null) { return(NotFound()); } if (!_suppliers.IsDeactive) { _suppliers.Deactivate(); } else if (_suppliers.IsDeactive) { _suppliers.Activate(); } _unitOfWork.Complete(); return(Ok()); }