Beispiel #1
0
        public ActionResult <List <Brewery> > GetListBreweries(int userId = 0, bool isBrewer = false)
        {
            List <Brewery> breweries;

            if (userId == 0)
            {
                breweries = breweryDAO.GetBreweries();
            }
            else if (isBrewer == false)
            {
                breweries = breweryDAO.GetBreweries(userId);
            }
            else
            {
                breweries = breweryDAO.GetBreweriesByBrewer(userId);
            }


            if (breweries != null)
            {
                return(Ok(breweries));
            }
            else
            {
                return(BadRequest());
            }
        }
Beispiel #2
0
 public IActionResult GetBreweries()
 {
     return(new JsonResult(breweryDAO.GetBreweries()));
 }
 public IEnumerable <Brewery> GetSearchResults(string searchString)
 {
     return(breweryDao.GetBreweries(searchString));
 }
Beispiel #4
0
        public List <Brewery> GetBreweries()
        {
            List <Brewery> breweryList = breweryDAO.GetBreweries();

            return(breweryList);
        }