Beispiel #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));
        }
Beispiel #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));
        }