Пример #1
0
        public async Task <IHttpActionResult> Get()
        {
            try
            {
                var result = await _repo.GetAllDishesAsync();

                var mapped = _mapper.Map <IEnumerable <DishModel> >(result);

                if (mapped == null)
                {
                    return(NotFound());
                }

                return(Ok(mapped));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }