public BrandsController(DataContext context) { _service = new BrandService(context); if (_service.FindAll().Result.Count() == 0) { AddBrands(context); } }
public async Task <IActionResult> GetAll() { try { List <Brand> brands = await _service.FindAll(); return(Ok(brands)); } catch (Exception e) { return(StatusCode(500, e)); } }