コード例 #1
0
        public ActionResult Create(Record record)
        {
            SetUser();
            record.Fk_UserId = _user.UserId;
            record.User      = _user;
            record.Exercise  = _repository.FindExercise((int)record.Fk_ExerciseId);

            if (ModelState.IsValid)
            {
                _repository.AddRecord(record);
                return(RedirectToAction("Get"));
            }

            return(View(record));
        }