Beispiel #1
0
        public async Task <IHttpActionResult> Get(int categoryId)
        {
            try
            {
                var result = await _repo.GetCategoryByIdAsync(categoryId);

                if (result == null)
                {
                    return(NotFound());
                }
                return(Ok(_mapper.Map <CategoryModel>(result)));
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }