Exemplo n.º 1
0
        public async Task <IHttpActionResult> Delete(int dishId, int itemId)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    _repo.DeleteItemFromADish(itemId, dishId);

                    if (_repo.SaveChanges())
                    {
                        return(Ok());
                    }
                }
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
            return(BadRequest());
        }