示例#1
0
        // GET api/<controller>
        public IHttpActionResult Get()
        {
            IHttpActionResult             result            = null;
            CompanyCategoryService        service           = new CompanyCategoryService();
            IEnumerable <CompanyCategory> companyCategories = service.GetCompanyCategories();

            if (companyCategories.Count() > 0)
            {
                result = Ok(companyCategories);
            }
            else
            {
                result = NotFound();
            }
            return(result);
        }