Example #1
0
        public ActionResult <List <BreweryEvent> > GetEvents(bool byBrewery = false, int breweryId = 0, bool byFavorites = false, int userId = 0)
        {
            List <BreweryEvent> events = null;

            if (byBrewery == false && byFavorites == false)
            {
                events = eventDAO.GetEvents();
            }
            else if (byBrewery == false && byFavorites == true)
            {
                events = eventDAO.GetEvents(userId);
            }
            else
            {
                events = eventDAO.GetEventsByBrewery(breweryId);
            }

            return(Ok(events));
        }