Esempio n. 1
0
        public async Task <IHttpActionResult> Get(int id)
        {
            var dish = await DishRepository.FindOneByAsync(elem => elem.Id == id);

            if (dish == null)
            {
                return(NotFound());
            }
            return(Ok(dish));
        }
Esempio n. 2
0
        public async Task <IHttpActionResult> Delete(int id)
        {
            var dish = await DishRepository.FindOneByAsync(elem => elem.Id == id);

            if (dish == null)
            {
                return(NotFound());
            }
            DishRepository.Delete(dish);
            await UnitOfWork.CommitAsync();

            return(Ok(dish));
        }