public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var resource = _resourcesRepository.Get((int)id);

            if (resource == null)
            {
                return(HttpNotFound());
            }
            resource.Technologies = resource.Technologies.OrderBy(a => a.Technology.Name).ToList();

            return(View(resource));
        }
        public ActionResult Add(int resourceId)
        {
            var resource = _resourcesRepository.Get(resourceId);

            if (resource == null)
            {
                return(HttpNotFound());
            }

            var viewModel = new ResourceTechnologiesAddViewModel()
            {
                Resource = resource
            };

            viewModel.Init(_technologyRepository);

            return(View(viewModel));
        }
Пример #3
0
        public IHttpActionResult Get(int id)
        {
            var resource = _resourcesRepository.Get(id);

            if (resource == null)
            {
                return(NotFound());
            }
            else
            {
                return(Ok(resource));
            }
        }