public async Task <ActionResult> Create([Bind(Include = "DocumentationTemplateID,DocumentationTemplateCode,Description,EntityTypeID,DocumentationPeriodicityID")] DocumentationTemplate documentationTemplate) { if (ModelState.IsValid) { await documentationTemplateRepository.CreateAsync(documentationTemplate); return(RedirectToAction("Index")); } ViewBag.EntityTypeID = new SelectList(entityTypeRepository.EntityTypes(), "EntityTypeID", "Description", documentationTemplate.EntityTypeID); return(View(documentationTemplate)); }
public async Task <ActionResult> Details(int id) { //if (id == null) //{ // return new HttpStatusCodeResult(HttpStatusCode.BadRequest); //} DocumentationTemplate documentationTemplate = await documentationTemplateRepository.FindDocumentationTemplateByIDAsync(id); if (documentationTemplate == null) { return(HttpNotFound()); } return(View(documentationTemplate)); }
public async Task <ActionResult> Edit(int id) { //if (id == null) //{ // return new HttpStatusCodeResult(HttpStatusCode.BadRequest); //} DocumentationTemplate documentationTemplate = await documentationTemplateRepository.FindDocumentationTemplateByIDAsync(id); if (documentationTemplate == null) { return(HttpNotFound()); } ViewBag.EntityTypeID = new SelectList(entityTypeRepository.EntityTypes(), "EntityTypeID", "Description", documentationTemplate.EntityTypeID); return(View(documentationTemplate)); }