public async Task <IActionResult> Edit(string id, [Bind("Id,Source,DosingInformation,SummaryMarkdown")] DrugLabelAnnotation drugLabelAnnotation) { if (id != drugLabelAnnotation.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(drugLabelAnnotation); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DrugLabelAnnotationExists(drugLabelAnnotation.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(drugLabelAnnotation)); }
public async Task <IActionResult> Create([Bind("Id,Source,DosingInformation,SummaryMarkdown")] DrugLabelAnnotation drugLabelAnnotation) { if (ModelState.IsValid) { _context.Add(drugLabelAnnotation); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(drugLabelAnnotation)); }