Esempio n. 1
0
        public IHttpActionResult GetForCalalog()
        {
            var companies = _companyServices.GetAll().Where(x => x.Enable).Select(x => (Models.Entities.Company)x);

            return(Ok(new
            {
                data = new
                {
                    companies
                }
            }));
        }
Esempio n. 2
0
 public IActionResult Get()
 {
     try
     {
         var companies = _companyServices.GetAll();
         if (companies == null)
         {
             return(NotFound());
         }
         return(Ok(companies));
     }
     catch (Exception ex)
     {
         ModelState.AddModelError("GetAllCompanies", ex.Message);
         return(BadRequest(ModelState));
     }
 }
Esempio n. 3
0
 public async Task <IList <CompanyModel> > GetAll()
 {
     return(await _companyServices.GetAll());
 }
 public IActionResult GetAll()
 {
     return(Json(_main.GetAll(null, null).Select(i => new CompanyListViewModel(i))));
 }
Esempio n. 5
0
 public IEnumerable <CompanyDto> Get() => _service.GetAll();