public async Task <IActionResult> Create([Bind("WorkoutLogId,DateTime,ExerciseId")] WorkoutLog workoutLog) { if (ModelState.IsValid) { _context.Add(workoutLog); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(workoutLog)); }
public async Task <IActionResult> Create([Bind("UserId,UserName,InductionCompleted,DateJoined")] User user) { if (ModelState.IsValid) { _context.Add(user); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(user)); }
public async Task <IActionResult> Create([Bind("CategoryId,CategoryName")] Category category) { if (ModelState.IsValid) { _context.Add(category); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(category)); }
public async Task <IActionResult> Create([Bind("ExerciseId,ExerciseName,CategoryId")] Exercis exercis) { if (ModelState.IsValid) { _context.Add(exercis); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CategoryId"] = new SelectList(_context.Categories, "CategoryId", "CategoryId", exercis.CategoryId); return(View(exercis)); }