Exemplo n.º 1
0
        public BrandsController(DataContext context)
        {
            _service = new BrandService(context);

            if (_service.FindAll().Result.Count() == 0)
            {
                AddBrands(context);
            }
        }
Exemplo n.º 2
0
        public async Task <IActionResult> GetAll()
        {
            try
            {
                List <Brand> brands = await _service.FindAll();

                return(Ok(brands));
            }
            catch (Exception e)
            {
                return(StatusCode(500, e));
            }
        }