Пример #1
0
        public ActionResult <CategoryViewModel> Get(Guid id)
        {
            var res = _bo.Read(id);

            if (res.Success)
            {
                if (res.Result == null)
                {
                    return(NotFound());
                }
                var rvm = new CategoryViewModel();
                rvm.Id   = res.Result.Id;
                rvm.Name = res.Result.Name;
                return(rvm);
            }

            else
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError));
            }
        }