public IHttpActionResult GetAllCompanies() { ResultEntity result = new ResultEntity(); List <CompanyEntity> companies = new List <CompanyEntity>(); try { companies = dal.FindAllCompanies().ToList <COMPANY>().ConvertAll <CompanyEntity>(c => c.ToCompanyEntity()); } catch (Exception e) { result.Message = e.Message; NtripProxyLogger.LogExceptionIntoFile("调用接口api/Company/GetAllCompanies异常,异常信息为:" + e.Message); } result.IsSuccess = result.Message == null; result.Data = companies; return(Json <ResultEntity>(result)); }