示例#1
0
        public ActionResult <CompanyReadDto> GetCompanyById(Guid id)
        {
            var companyItem = _repository.GetCompanyById(id);

            // If found, return Model mapped as DTO object
            if (companyItem != null)
            {
                return(Ok(_mapper.Map <CompanyReadDto>(companyItem)));
            }
            return(NotFound());
        }
示例#2
0
        private bool companyExists(Guid companyId)
        {
            var checkCompanyId = _companyrepository.GetCompanyById(companyId);

            if (checkCompanyId == null)
            {
                return(false);
            }
            return(true);
        }