internal Contractor GetById(int id) { Contractor contractor = _contractorsRepository.GetById(id); if (contractor == null) { throw new Exception("Invalid Id"); } return(contractor); }
internal Contractor GetById(int id) { var data = _repo.GetById(id); if (data == null) { throw new Exception("Invalid Id"); } return(data); }
internal IEnumerable <Review> GetByContractorId(int id) { var con = _conRepo.GetById(id); if (con == null) { throw new Exception("Inavlid Id"); } return(_repo.GetByContractorId(id)); }
internal IEnumerable <Review> GetByContractorId(int id) { // RULE Check that the parent id exists before fetching children var prod = _contRepo.GetById(id); if (prod == null) { throw new Exception("Invalid Contractor Id"); } return(_repo.GetByContractorId(id)); }
public ActionResult <Contractor> Get(int id) { try { return(Ok(_Repo.GetById(id))); } catch (Exception e) { return(BadRequest(e.Message)); } }
public void EditContractor(Contractor contractor) { var original = contractorsRepository.GetById(c => c.ContractorId == contractor.ContractorId); contractorsRepository.Update(original, contractor.AutoMapObject <Contractor, DB.Contractor>()); }
public ActionResult <Contractor> GetOne(string Id) { return(Ok(_cr.GetById(Id))); }