public async Task<IActionResult> Edit(Guid id, [Bind("EventGolfId,Id,Feature")] EventGolfFeatures eventGolfFeatures) { if (id != eventGolfFeatures.EventGolfId) { return NotFound(); } if (ModelState.IsValid) { try { _context.Update(eventGolfFeatures); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EventGolfFeaturesExists(eventGolfFeatures.EventGolfId)) { return NotFound(); } else { throw; } } return RedirectToAction("Index"); } ViewData["EventGolfId"] = new SelectList(_context.EventGolf, "Id", "TypeOfEvent", eventGolfFeatures.EventGolfId); return View(eventGolfFeatures); }
public async Task<IActionResult> Create([Bind("EventGolfId,Id,Feature")] EventGolfFeatures eventGolfFeatures) { if (ModelState.IsValid) { eventGolfFeatures.EventGolfId = Guid.NewGuid(); _context.Add(eventGolfFeatures); await _context.SaveChangesAsync(); return RedirectToAction("Index"); } ViewData["EventGolfId"] = new SelectList(_context.EventGolf, "Id", "TypeOfEvent", eventGolfFeatures.EventGolfId); return View(eventGolfFeatures); }