Ejemplo 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
                }
            }));
        }
Ejemplo 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));
     }
 }
Ejemplo 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))));
 }
Ejemplo n.º 5
0
 public IEnumerable <CompanyDto> Get() => _service.GetAll();