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

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

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