public ActionResult Create([Bind("Name")] Plantype plantype) { if (ModelState.IsValid) { typeRepository.Add(plantype); return(RedirectToAction("Index")); } return(Ok(plantype)); }
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()); }