예제 #1
0
        public IHttpActionResult GetAllFavorites()
        {
            LiquorService liquorService = new LiquorService();
            var           faveliquors   = liquorService.GetFaveLiquors();

            return(Ok(faveliquors));
        }
예제 #2
0
        public IHttpActionResult GetLiquorById(int id)
        {
            LiquorService liquorService = new LiquorService();
            var           liquors       = liquorService.GetLiquorById(id);

            return(Ok(liquors));
        }
예제 #3
0
        public IHttpActionResult GetAll()
        {
            LiquorService liquorService = new LiquorService();
            var           liquors       = liquorService.GetLiquors();

            return(Ok(liquors));
        }
예제 #4
0
        public IHttpActionResult Delete(int id)
        {
            var service = new LiquorService();

            if (!service.DeleteLiquor(id))
            {
                return(InternalServerError());
            }

            return(Ok());
        }
예제 #5
0
        public IHttpActionResult Put(LiquorEdit liquor)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var service = new LiquorService();

            if (!service.UpdateLiquor(liquor))
            {
                return(InternalServerError());
            }

            return(Ok());
        }