public async Task <IActionResult> Create([Bind("EventID,Date,Description,TimelineID,Title")] Event @event) { if (ModelState.IsValid) { _context.Add(@event); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewData["TimelineID"] = new SelectList(_context.Timelines, "TimelineID", "TimelineID", @event.TimelineID); return(View(@event)); }
public async Task <IActionResult> Create([Bind("Credits,FocusID,Title,Description,BeginDate,EndDate")] Timeline timeline) { if (ModelState.IsValid) { _context.Add(timeline); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } PopulateFocusesDropDownList(timeline.FocusID); return(View(timeline)); }