public WorkoutSetViewModel(IWorkoutService workoutService, int userId) { UserId = userId; UserTotalResult = workoutService.GetUserTotalResult(userId); var lastSet = workoutService.GetSets(userId).OrderByDescending(_ => _.Id).FirstOrDefault(); var lastReps = lastSet?.Reps ?? 50; Reps = lastReps; }
public ActionResult History(int userId) { var sets = _WorkoutService.GetSets(userId).ToList(); return(View(sets)); }