public async Task <IActionResult> Create(WorkoutSessionCreateViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            var command = new CreateWorkoutSessionCommand
            {
                Description    = model.Description,
                Date           = model.Date,
                WorkoutRecords = model.WorkoutRecords.Select(wr => new WorkoutRecord()
                {
                    ActivityName      = wr.ActivityName,
                    DurationInMinutes = wr.Duration,
                    NumberOfReps      = wr.Reps,
                    NumberOfSets      = wr.Sets,
                    MusclesTargeted   = wr.MusclesListIds.Select(w => new WorkoutRecordMuscle
                    {
                        MuscleId = w
                    }).ToList()
                }).ToList()
            };
            await _workoutSessionService.AddWorkoutSession(command);

            return(RedirectToAction("Index"));
        }
        public async Task <WorkoutSession> AddWorkoutSession(CreateWorkoutSessionCommand command)
        {
            var workoutSession = new WorkoutSession
            {
                Description    = command.Description,
                Date           = command.Date,
                WorkoutRecords = command.WorkoutRecords,
                UserId         = 1 // TODO : Change to proper userId
            };

            _context.WorkoutSessions.Add(workoutSession);
            await _context.SaveChangesAsync();

            return(workoutSession);
        }