Exemplo n.º 1
0
        public ActionResult Create([Bind("Name")] Plantype plantype)
        {
            if (ModelState.IsValid)
            {
                typeRepository.Add(plantype);
                return(RedirectToAction("Index"));
            }

            return(Ok(plantype));
        }
Exemplo n.º 2
0
        public ActionResult Edit([Bind("Id,Name")] Plantype plantype)
        {
            var model = typeRepository.FindByID(plantype.Id);

            if (model == null)
            {
                return(StatusCode(StatusCodes.Status404NotFound));
            }
            typeRepository.Update(plantype);
            return(NoContent());
        }